Project Commands
Project commands create a configuration and prepare database targets. Both are free.
init
Create a new dubnium.yml in the current folder.
Alias: -i
dbm init
dbm -i
If dubnium.yml already exists, Dubnium reports an error and leaves the file untouched.
The generated file records the Dubnium version that created it (CreatedByDubniumVersion) and starts with one local target that reads its connection string from the DUBNIUM_LOCAL_CONNECTION_STRING environment variable:
ConfigurationVersion: 2
CreatedByDubniumVersion: '1.1.94'
ProjectName: '>>>>'
MigrationPath: 'Migration'
Databases:
- Key: 'local'
Name: 'Local'
Connection:
Source: EnvironmentVariable
Value: 'DUBNIUM_LOCAL_CONNECTION_STRING'
Registration:
LicensedEmail: ''
RegistrationCode: ''
TempPath: 'c:\temp\'
SchemaPath: 'Schema'
Verbose: false
DryRun: false
TablesToDump:
-
DataMigration:
Folder: 'DataDump'
Tables:
-
DefaultMatchColumn: 'Ukey'
TableMatchColumns: {}
CreatedBy: 'Dubnium'
UpdatedBy: 'Dubnium'
FailFast: true
SettingMigration:
Folder: 'Setting'
Tables:
-
MatchColumn: 'Ukey'
TableMatchColumns: {}
FileNameColumn: 'Name'
IgnoreColumns:
- 'Id'
- 'CreatedAt'
- 'CreatedBy'
- 'UpdatedAt'
- 'UpdatedBy'
CreatedBy: 'Dubnium'
UpdatedBy: 'Dubnium'
FailFast: true
SchemaDocumentation:
MarkdownPath: 'Documentation\DatabaseSchema.md'
PdfPath: 'Documentation\DatabaseSchema.pdf'
StandardColumns: []
Skip:
Tables:
-
TableRegexPatterns:
-
StoredProcedures:
-
StoredProcedureRegexPatterns:
-
Next steps:
- Replace the
>>>>placeholder inProjectName. Dubnium refuses to load a file that still contains>>>>. - Set the connection environment variable, or change the target's
Connection(see Configuration). - Add registration details if you use paid commands.
- Run
dbm setup local.
setup
Prepare a database target for Dubnium.
dbm setup <target>
dbm setup local
What it does:
- Creates
dbo.__DubniumInfoif it is missing. This table records each deployed script'sVersion,Description, andScriptType. - Upgrades an older
__DubniumInfoby adding theScriptTypeandMigrationTypecolumns and copying values between them. - Creates the
Platform,Generated, andApplicationfolders underMigrationPath.
Setup is safe to run again: every step checks what already exists.
Prerequisites:
- The target's connection resolves
- The database user can create and alter tables in
dbo
With DryRun: true, setup prints the SQL and folders it would create without changing anything.