Red Gate forums :: View topic - Does the TeamCity plugin ignore /Exclude:table?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
Deployment Manager
Deployment Manager forum

Does the TeamCity plugin ignore /Exclude:table?

Search in Deployment Manager forum
Post new topic   Reply to topic
Jump to:  
Author Message
isme



Joined: 12 Jun 2012
Posts: 75
Location: Edinburgh

PostPosted: Mon Dec 09, 2013 8:25 pm    Post subject: Does the TeamCity plugin ignore /Exclude:table? Reply with quote

Hey RG,

I'm trying to package my database structure without tables.

I set the /Exclude:tables option in the Red Gate build step.



When TeamCity validates the database creation script, the build log shows that tables are still created.

Code:

[19:10:42]Creating [Customer].[tbCustomer]
[19:10:42]Creating primary key [PK_tbCustomer] on [Customer].[tbCustomer]
[19:10:42]Creating [Customer].[tbCustomerPermission]
[19:10:42]Creating primary key [PK_tbCustomerPermission] on [Customer].[tbCustomerPermission]
[...]


Indeed, the CreationScript.sql in the NuGet package contains a bunch of CREATE TABLE statements.

Code:

PRINT N'Creating [Customer].[tbCustomer]'
GO
CREATE TABLE [Customer].[tbCustomer] (...)
GO
[...]
PRINT N'Creating primary key [PK_tbCustomer] on [Customer].[tbCustomer]'
GO
ALTER TABLE [Customer].[tbCustomer] ADD CONSTRAINT [PK_tbCustomer] PRIMARY KEY ...
GO


The option works on my workstation, so why not in TeamCity?

Am I missing something?

Thanks!
_________________
Iain Elder, Skyscanner
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1123
Location: My desk.

PostPosted: Tue Dec 10, 2013 4:37 pm    Post subject: Reply with quote

I'm just having a quick look at this myself- I do see something similar however the tables aren't in the original creation:

Code:


[15:29:55][Generating creation script] Starting: C:\TeamCity\buildAgent\plugins\RedGateSQLServer\assets\SC\SQLCompare.exe /include="Identical" /include="StaticData" /scripts1="C:\TeamCity\buildAgent\temp\buildTmp\ogcy0gcr.e0o\db\state" /o="default,ignoretSQLt" /scripts2="C:\TeamCity\buildAgent\temp\buildTmp\yimiyhwz.spo" /scriptfile="C:\TeamCity\buildAgent\temp\buildTmp\ogcy0gcr.e0o\db\CreationScript.sql" /options="itst,iwn" /abortOnWarnings="None" /Exclude="table"
[15:29:55][Generating creation script] SQL Compare: activated, edition: professional, serial number: 507-001-185110-EC2A
[15:29:56][Generating creation script] SQL Compare Command Line V10.5.0.378
[15:29:56][Generating creation script] ==============================================================================
[15:29:56][Generating creation script] Copyright ΒΈ Red Gate Software Ltd 1999-2013
[15:29:56][Generating creation script]
[15:29:56][Generating creation script] Registering data sources
[15:30:02][Generating creation script] Creating mappings
[15:30:03][Generating creation script] Comparing
[15:30:03][Generating creation script]
[15:30:03][Generating creation script] Applying Command Line Items
[15:30:03][Generating creation script]
[15:30:03][Generating creation script] Retrieving migration scripts
[15:30:03][Generating creation script] Checking for identical databases
[15:30:03][Generating creation script] Creating SQL
[15:30:05][Generating creation script] Inserting static data SQL into deployment script
[15:30:05][Generating creation script] Saving SQL
[15:30:05][Generating creation script]
[15:30:05][Generating creation script] Summary Information
[15:30:05][Generating creation script] ===============================================================================
[15:30:05][Generating creation script] DB1 = state
[15:30:05][Generating creation script] DB2 = yimiyhwz.spo
[15:30:05][Generating creation script]
[15:30:05][Generating creation script] Object type     Name                                           Records DB1 DB2
[15:30:05][Generating creation script] -------------------------------------------------------------------------------
[15:30:05][Generating creation script] Role            db_datareader                                          ==  == 
[15:30:05][Generating creation script] Role            db_accessadmin                                         ==  == 
[15:30:05][Generating creation script] Role            db_ddladmin                                            ==  == 
[15:30:05][Generating creation script] Role            db_owner                                               ==  == 
[15:30:05][Generating creation script] Role            db_securityadmin                                       ==  == 
[15:30:05][Generating creation script] Role            db_backupoperator                                      ==  == 
[15:30:05][Generating creation script] Role            db_denydatareader                                      ==  == 
[15:30:05][Generating creation script] Role            db_denydatawriter                                      ==  == 
[15:30:05][Generating creation script] Role            public                                                 ==  == 
[15:30:05][Generating creation script] Role            db_datawriter                                          ==  == 
[15:30:05][Generating creation script] Schema          db_owner                                               ==  == 
[15:30:05][Generating creation script] Schema          db_accessadmin                                         ==  == 
[15:30:05][Generating creation script] Schema          db_ddladmin                                            ==  == 
[15:30:05][Generating creation script] Schema          db_datareader                                          ==  == 
[15:30:05][Generating creation script] Schema          db_securityadmin                                       ==  == 
[15:30:05][Generating creation script] Schema          db_backupoperator                                      ==  == 
[15:30:05][Generating creation script] Schema          db_datawriter                                          ==  == 
[15:30:05][Generating creation script] Schema          db_denydatareader                                      ==  == 
[15:30:05][Generating creation script] Schema          INFORMATION_SCHEMA                                     ==  == 
[15:30:05][Generating creation script] Schema          db_denydatawriter                                      ==  == 
[15:30:05][Generating creation script] Schema          guest                                                  ==  == 
[15:30:05][Generating creation script] Schema          sys                                                    ==  == 
[15:30:05][Generating creation script] Schema          Widgets                                                >>     
[15:30:05][Generating creation script] Schema          dbo                                                    ==  == 
[15:30:05][Generating creation script] View            [dbo].[vwMoods]                                        >>     
[15:30:05][Generating creation script] View            [dbo].[vwColors]                                       >>     
[15:30:05][Generating creation script] View            [dbo].[vwContacts]                                     >>     
[15:30:05][Generating creation script] View            [dbo].[WidgetPriceList]                                >>     
[15:30:05][Generating creation script] View            [dbo].[vwMood]                                         >>     
[15:30:05][Generating creation script] View            [dbo].[View_1]                                         >>     
[15:30:05][Generating creation script] StoredProcedure [dbo].[SelectOne]                                      >>     
[15:30:05][Generating creation script] Assembly        [SQLAssembly]                                          >>     
[15:30:05][Generating creation script] ExtendedPropert       MS_Description                                   >>     
[15:30:05][Generating creation script] -------------------------------------------------------------------------------


You'll see no tables are mentioned... but then when we verify:

Code:

[15:30:05][Validating creation script: Executing creation script] Creating [dbo].[colors]
[15:30:05][Validating creation script: Executing creation script] Creating primary key [PK_colors] on [dbo].[colors]
[15:30:05][Validating creation script: Executing creation script] Creating [dbo].[vwColors]


It does seem to be creating a table... also worth mentioning that the final package pushed through to Deployment Manager contains tables too.

I'll see if I can fathom it out.
Back to top
View user's profile Send private message
isme



Joined: 12 Jun 2012
Posts: 75
Location: Edinburgh

PostPosted: Mon Jan 20, 2014 2:54 pm    Post subject: Reply with quote

Hi James,

Jonthan Hickford explained that the compare options field is currently ignored in the packaging step.

He documented a workaround on the deployment manager website in an article called Customer Specific Database Deployments.

We followed his example. Our workaround is to filter objects before the 'Red Gate' step in a PowerShell step that invokes sqlcompate.exe with a scpf filter.

Would you be able to confirm whether the 'additional switches' functionailty will be fully implemented?

Thanks for investigating.
_________________
Iain Elder, Skyscanner
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1123
Location: My desk.

PostPosted: Mon Jan 20, 2014 2:55 pm    Post subject: Reply with quote

Adding full support for the SQL Compare options is pretty high up on the list right now AFAIK (i.e. second/third thing in the list, last time I saw) so I'm hoping that this will appear soon...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group