Examining The Product Repository Structure - Schema-Smith/SchemaSmithEnterpriseDemos GitHub Wiki
Opinionated file structure
SchemaSmithyFree has a convention over configuration approach not unlike a Ruby on Rails or Chef project.
Based on the Test Product
├── Product.json
├── Jobs
│ ├── SubFolder
│ │ └── Job 2.sql
│ └── Job 1.sql
├── Templates
│ ├── Main
│ │ ├── MigrationScripts
│ │ │ ├── After
│ │ │ └── Before
│ │ │ └── MigrationScript1 [ALWAYS].sql
│ │ ├── Schemas
│ │ │ └── MySchema.sql
│ │ ├── DataTypes
│ │ │ └── Type1.sql
│ │ ├── FullTextCatalogs
│ │ │ └── MyCatalog.sql
│ │ ├── FullTextStopLists
│ │ │ └── MyStopList.sql
│ │ ├── Functions
│ │ │ └── dbo.MyFunction.sql
│ │ └── Views
│ │ │ └── dbo.MyView.sql
│ │ ├── Procedures
│ │ │ └── dbo.MyProcedure.sql
│ │ ├── Triggers
│ │ │ └── dbo.MyTrigger.sql
│ │ ├── Tables
│ │ │ └── dbo.TestTable.json
│ │ └── Template.json
│ └── Secondary
│ ├── MigrationScripts
│ │ ├── After
│ │ │ └── MigrationScript1.sql
│ │ └── Before
│ ├── Schemas
│ ├── DataTypes
│ ├── FullTextCatalogs
│ ├── FullTextStopLists
│ ├── Functions
│ ├── Views
│ ├── Procedures
│ ├── Triggers
│ ├── Tables
│ └── Template.json
└── UILookupTables
├── Categories.json
└── MyLookupItems.json
The folder structure for scripts and most objects is fully configurable in the Product and Template .json
files. Configurable Product and Template script folders
Execution order
The execution order is determined first by the quench slot
for the folder, next by the order each base folder appears within the configuration file and finally by alpha sorting the files within the folder by name. At the template level, scripts in the before
, after tables
, and after
slots will run only once by default. You can have them run every time if the file name ends with [ALWAYS]
before the .sql
extension. Other file extensions will be ignored by SchemaQuench.
Additionally, after tables are updated, any object
and after table object
scripts that failed to apply before updating tables are applied again until all dependencies are satisfied and no more errors are generated or further progress can not be made because there is a legitimate error.