What are the challenges you face when working across database platforms? Take the survey
Options

Static data not being deployed

markgmarkg Posts: 10 Bronze 1
edited May 3, 2016 11:15AM in DLM Automation
I appear to be having an issue with static data not being deployed using the SQL release templates with Octopus Deploy.

I'm using the standard "Redgate - Deploy from Package" step template. I have confirmed that IgnoreStaticData is set to false, I have also opened the nuget package and confirm there are data scripts in the dbstateDatabaseData folder.

Is there something I'm missing?

Here are the logs (sanitized):
14:58:03 Info | WARNING: 'New-DatabaseConnection' has been renamed 'New-DlmDatabaseConnection'.
14:58:03 Info | WARNING: 'Test-DatabaseConnection' has been renamed
14:58:03 Info | 'Test-DlmDatabaseConnection'.
14:58:03 Info | New-DatabaseConnection, SQL Release 1.3.16.1507, Copyright c Red Gate Software Ltd 2014-2016
14:58:03 Info | In trial: expires 2016/05/28 19:14:15 -05:00
14:58:03 Info | Test-DatabaseConnection, SQL Release 1.3.16.1507, Copyright c Red Gate Software Ltd 2014-2016
14:58:03 Info | WARNING: 'New-DatabaseRelease' has been renamed 'New-DlmDatabaseRelease'.
14:58:03 Info | New-DatabaseRelease, SQL Release 1.3.16.1507, Copyright c Red Gate Software Ltd 2014-2016
14:58:03 Info | VERBOSE: Parameters:
14:58:03 Info | Source: scripts folder
14:58:03 Info | 'C:OctopusApplicationsTest[DBPACKAGE]1.0.57dbstate'
14:58:03 Info | Target: database '[DATABASE]' on server '[SQLSERVER]'
14:58:03 Info | FilterPath: null
14:58:03 Info | IgnoreStaticData: False
14:58:03 Info | SQLCompareOptions: null
14:58:03 Info | TransactionIsolationLevel: Serializable
14:58:03 Info | IncludeIdenticalsInReport: False
14:58:03 Info | TemporaryDatabaseServer: null
14:58:03 Info | Making a scripts folder of database '[DATABASE]' on server '[SQLSERVER]'.
14:58:03 Info | VERBOSE: Calling: C:Program Files (x86)Red GateDLM Automation Suite
14:58:03 Info | 1SCSQLCompare.exe "/makescripts:C:WindowsTEMPSQL Releasecarskagd.5o0"
14:58:03 Info | /force /options:DecryptPost2kEncryptedObjects,IncludeDependencies
14:58:03 Info | /OutputWidth:1024 /server1:[SQLSERVER] /database1:[DATABASE]
14:58:03 Info | /username1:[user] /password1:******** /out:"C:WindowsTEMPSQL
14:58:03 Info | Releaseqgdmfqtx.log"
14:58:04 Info | VERBOSE: C:Program Files (x86)Red GateDLM Automation Suite
14:58:04 Info | 1SCSQLCompare.exe ended with exit code 0
14:58:04 Info | VERBOSE: SQLCompare.exe completed successfully.
14:58:04 Info | Creating the update script.
14:58:04 Info | VERBOSE: Calling: C:Program Files (x86)Red GateDLM Automation Suite
14:58:04 Info | 1SCSQLCompare.exe
14:58:04 Info | /options:ConsiderNextFilegroupInPartitionSchemes,DecryptPost2kEncryptedObjects,
14:58:04 Info | DoNotOutputCommentHeader,ForceColumnOrder,IgnoreCertificatesAndCryptoKeys,Ignor
14:58:04 Info | eDatabaseAndServerName,IgnoreTSQLT,IgnoreUserProperties,IgnoreUsersPermissionsA
14:58:04 Info | ndRoleMemberships,IgnoreWhiteSpace,IgnoreWithElementOrder,IncludeDependencies,T
14:58:04 Info | hrowOnFileParseFailed,UseCompatibilityLevel,UseMigrationsV2
14:58:04 Info | /transactionIsolationLevel:SERIALIZABLE /include:staticData
14:58:04 Info | "/scriptFile:C:WindowsTEMPSQL Releaserfw1tap.sql" /showWarnings
14:58:04 Info | /include:Identical "/report:C:WindowsTEMPSQL Release3ombf3t.xml"
14:58:04 Info | /reportType:Xml /force /OutputWidth:1024 "/scripts1:C:WindowsTEMPSQL
14:58:04 Info | Releasemv4vx1hz.e1h" "/scripts2:C:WindowsTEMPSQL Releasekg4rhryw.2nj"
14:58:04 Info | /out:"C:WindowsTEMPSQL Release22rtcorf.log"
14:58:06 Info | VERBOSE: C:Program Files (x86)Red GateDLM Automation Suite
14:58:06 Info | 1SCSQLCompare.exe ended with exit code 0
14:58:06 Info | VERBOSE: SQLCompare.exe completed successfully.
14:58:06 Info | Timeout = 30
14:58:06 Info | WARNING: 'Use-DatabaseRelease' has been renamed 'Use-DlmDatabaseRelease'.
14:58:06 Info | Use-DatabaseRelease, SQL Release 1.3.16.1507, Copyright c Red Gate Software Ltd 2014-2016
14:58:06 Info | VERBOSE: Parameters:
14:58:06 Info | InputObject: Database Release
14:58:06 Info | DeployTo: database '[DATABASE]' on server '[SQLSERVER]'
14:58:06 Info | SkipPreUpdateSchemaCheck: True
14:58:06 Info | SkipPostUpdateSchemaCheck: False
14:58:06 Info | QueryBatchTimeout: 30
14:58:06 Info | Skipping check of target database schema before applying update.
14:58:06 Info | Applying update script to database '[DATABASE]' on server '[SQLSERVER]'.
14:58:06 Info | Dropping foreign keys from [dbo].[AlternatePayee]
14:58:06 Info | Dropping constraints from [dbo].[AlternatePayee]
14:58:06 Info | Dropping constraints from [dbo].[AlternatePayee]
14:58:06 Info | Dropping constraints from [dbo].[AlternatePayee]
14:58:06 Info | Dropping constraints from [dbo].[AlternatePayee]
14:58:06 Info | Dropping constraints from [dbo].[__MigrationHistory]
14:58:06 Info | Dropping index [IX_PayeeId] from [dbo].[AlternatePayee]
14:58:06 Info | Dropping [dbo].[__MigrationHistory]
14:58:06 Info | Dropping [dbo].[AlternatePayee]
14:58:06 Info | The database update succeeded
14:58:06 Info | Update script successfully applied to database '[DATABASE]' on server '[SQLSERVER]'.
14:58:06 Info | Checking target database schema is in expected state:
14:58:06 Info | Comparing the schema in the Database Release object (created at 4/30/2016 2:58:03 PM -05:00) to the current schema of database '[DATABASE]' on server '[SQLSERVER]'.
14:58:06 Info | VERBOSE: Calling: C:Program Files (x86)Red GateDLM Automation Suite
14:58:06 Info | 1SCSQLCompare.exe
14:58:06 Info | /options:ConsiderNextFilegroupInPartitionSchemes,DecryptPost2kEncryptedObjects,
14:58:06 Info | DoNotOutputCommentHeader,ForceColumnOrder,IgnoreCertificatesAndCryptoKeys,Ignor
14:58:06 Info | eDatabaseAndServerName,IgnoreTSQLT,IgnoreUserProperties,IgnoreUsersPermissionsA
14:58:06 Info | ndRoleMemberships,IgnoreWhiteSpace,IgnoreWithElementOrder,IncludeDependencies,T
14:58:06 Info | hrowOnFileParseFailed,UseCompatibilityLevel,UseMigrationsV2 /include:staticData
14:58:06 Info | /OutputWidth:1024 "/scripts1:C:WindowsTEMPSQL Releaseoewcg2sf.qi5"
14:58:06 Info | /server2:[SQLSERVER] /database2:[DATABASE] /username2:[user]
14:58:06 Info | /password2:******** /out:"C:WindowsTEMPSQL Releasexjvndiuh.log"
14:58:08 Info | VERBOSE: C:Program Files (x86)Red GateDLM Automation Suite
14:58:08 Info | 1SCSQLCompare.exe ended with exit code 63
14:58:08 Info | VERBOSE: SQLCompare.exe completed successfully.
14:58:08 Info | Updates to database '[DATABASE]' on server '[SQLSERVER]' were deployed. Current schema now matches the schema of scripts folder 'C:OctopusApplicationsTest[DBPACKAGE]1.0.57dbstate' (created at 4/30/2016 2:58:03 PM -05:00).

Comments

  • Options
    markgmarkg Posts: 10 Bronze 1
    I figured out the problem. The build was using the folder underneath the Database/Migrations folders and not the Database folder explicitly. I haven't used it enough to understand how it all works, but if I have the Database folder selected, how do the Migrations get included?
  • Options
    Hi Mark,

    Unfortunately SQL Release does not work with Migrations v1. We are currently working on improving Migrations and getting them to work with SQL CI and SQL Release, this should be done by the end of the month. The beta has finished and is almost ready for release. For more information check out:
    https://documentation.red-gate.com/disp ... ease+notes
    https://documentation.red-gate.com/disp ... on+scripts

    Also as you correctly point out it needs to point at the Database folder rather than its parent to work with filters and static data, this should be done at build time (sqlci build or Invoke-DlmDatabaseSchemaValidation)
    Peter Gerrard

    Software Engineer
    Redgate Software
Sign In or Register to comment.