Skip to main content

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:

  1. Replace the >>>> placeholder in ProjectName. Dubnium refuses to load a file that still contains >>>>.
  2. Set the connection environment variable, or change the target's Connection (see Configuration).
  3. Add registration details if you use paid commands.
  4. Run dbm setup local.

setup​

Prepare a database target for Dubnium.

dbm setup <target>
dbm setup local

What it does:

  1. Creates dbo.__DubniumInfo if it is missing. This table records each deployed script's Version, Description, and ScriptType.
  2. Upgrades an older __DubniumInfo by adding the ScriptType and MigrationType columns and copying values between them.
  3. Creates the Platform, Generated, and Application folders under MigrationPath.

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.