Using GenerateChangeLog with multiple SQLServer Schemas

There is a defaultSchemaName parameter that should allow you to specify a different schema. You can’t specify multiple schemas at one time, currently, however.


Nathan

Hi, I’m connecting to a MS SQL Server DBMS to generate a changelog as the first step towards using Liquibase.  Whilst it creates a changeLogFile correctly, it only does so for the ‘defaultSchema’ of ‘DBO’ (as shown by the log output here):

liquibase generateChangeLog
INFO 05/12/11 15:58:liquibase: Reading tables for XXX @ jdbc:sqlserver://DBMS:1433;responseBuffering=full;encrypt=false;databaseName=DBMSName
1;selectMethod=direct;trustServerCertificate=false;lastUpdateCount=true; (Default Schema: dbo) …


Is there a parameter I can set to specify the schema to generate for, please?  Thanks.  Ian

Thanks Nathan.  I’ve tried using that:

liquibase --defaultSchemaName=SCM --defaultsFile=liquibaseParty.properties generateChangeLog

both in the command line and in the properties file, and whilst it no longer outputs the ‘dbo’ schema, it doesn’t output the ‘SCM’ schema either.   I don’t suppose you have any more ideas - or can see if I’ve got the syntax wrong in the command line?  Thanks for any help.  Ian

Just thought I should give you the debug output too:

D:\liquibaseTrial>…\liquibase\liquibase --logLevel=debug --defaultsFile=liquibaseSCM.properties generateChangeLog
DEBUG 06/12/11 10:34:liquibase: Unable to load/access Apache Derby driver class org.apache.derby.tools.sysinfo to check version: org.apache.derby.tools.sys
info
DEBUG 06/12/11 10:34:liquibase: Connected to UserName@jdbc:sqlserver://MCName:1433;responseBuffering=full;encrypt=false;databaseName=DBName;selec
tMethod=direct;trustServerCertificate=false;lastUpdateCount=true;
DEBUG 06/12/11 10:34:liquibase: Reading tables for UserName @ jdbc:sqlserver://MCName:1433;responseBuffering=full;encrypt=false;databaseName=DBName;selectMethod=direct;trustServerCertificate=false;lastUpdateCount=true; (Default Schema: SCM) …
INFO 06/12/11 10:34:liquibase: Reading tables for UserName @ jdbc:sqlserver://MCName:1433;responseBuffering=full;encrypt=false;databaseName=DBName;selectMethod=direct;trustServerCertificate=false;lastUpdateCount=true; (Default Schema: SCM) …
DEBUG 06/12/11 10:34:liquibase: Reading views for UserName @ jdbc:sqlserver://MCName:1433;responseBuffering=full;encrypt=false;databaseName=DBName;selectMethod=direct;trustServerCertificate=false;lastUpdateCount=true; (Default Schema: SCM) …
INFO 06/12/11 10:34:liquibase: Reading views for UserName @ jdbc:sqlserver://MCName:1433;responseBuffering=full;encrypt=false;databaseName=DBName
;selectMethod=direct;trustServerCertificate=false;lastUpdateCount=true; (Default Schema: SCM) …
DEBUG 06/12/11 10:34:liquibase: Reading foreign keys for UserName @ jdbc:sqlserver://MCName:1433;responseBuffering=full;encrypt=false;databaseName=DBName;selectMethod=direct;trustServerCertificate=false;lastUpdateCount=true; (Default Schema: SCM) …
INFO 06/12/11 10:34:liquibase: Reading foreign keys for UserName @ jdbc:sqlserver://MCName:1433;responseBuffering=full;encrypt=false;databaseName=DBName;selectMethod=direct;trustServerCertificate=false;lastUpdateCount=true; (Default Schema: SCM) …
DEBUG 06/12/11 10:34:liquibase: Reading primary keys for UserName @ jdbc:sqlserver://MCName:1433;responseBuffering=full;encrypt=false;databaseName=DBName;selectMethod=direct;trustServerCertificate=false;lastUpdateCount=true; (Default Schema: SCM) …
INFO 06/12/11 10:34:liquibase: Reading primary keys for UserName @ jdbc:sqlserver://MCName:1433;responseBuffering=full;encrypt=false;databaseName=DBName;selectMethod=direct;trustServerCertificate=false;lastUpdateCount=true; (Default Schema: SCM) …
DEBUG 06/12/11 10:34:liquibase: Reading columns for UserName @ jdbc:sqlserver://MCName:1433;responseBuffering=full;encrypt=false;databaseName=DBName;selectMethod=direct;trustServerCertificate=false;lastUpdateCount=true; (Default Schema: SCM) …
INFO 06/12/11 10:34:liquibase: Reading columns for UserName @ jdbc:sqlserver://MCName:1433;responseBuffering=full;encrypt=false;databaseName=DBName;selectMethod=direct;trustServerCertificate=false;lastUpdateCount=true; (Default Schema: SCM) …
DEBUG 06/12/11 10:34:liquibase: Could not find table or view scaSCMClaimNarrat for column scaSID
DEBUG 06/12/11 10:34:liquibase: Could not find table or view scaSCMClaimNarrat for column scaQlfr
DEBUG 06/12/11 10:34:liquibase: Could not find table or view scaSCMClaimNarrat for column scaParaRef
DEBUG 06/12/11 10:34:liquibase: Could not find table or view scaSCMClaimNarrat for column scaSeq
DEBUG 06/12/11 10:34:liquibase: Could not find table or view scaSCMClaimNarrat for column scaNarrat
DEBUG 06/12/11 10:34:liquibase: Could not find table or view scaSCMClaimNarrat for column scaSIDscm
DEBUG 06/12/11 10:34:liquibase: Could not find table or view scaSCMClaimNarrat for column scaUpdDate
DEBUG 06/12/11 10:34:liquibase: Could not find table or view scaSCMClaimNarrat for column scaModVersn
DEBUG 06/12/11 10:34:liquibase: Could not find table or view scaSCMClaimNarrat for column scaUserLastUpdSIDusr
DEBUG 06/12/11 10:34:liquibase: Could not find table or view scaSCMClaimNarrat for column scaInsSIDusr
DEBUG 06/12/11 10:34:liquibase: Could not find table or view scaSCMClaimNarrat for column scaInsDate
DEBUG 06/12/11 10:34:liquibase: Could not find table or view sccSCMCtrl for column sccSID
DEBUG 06/12/11 10:34:liquibase: Could not find table or view sccSCMCtrl for column sccMsgSource
DEBUG 06/12/11 10:34:liquibase: Could not find table or view sccSCMCtrl for column sccMsgRefNmbr
DEBUG 06/12/11 10:34:liquibase: Could not find table or view sccSCMCtrl for column sccMsgVersnNmbr
DEBUG 06/12/11 10:34:liquibase: Could not find table or view sccSCMCtrl for column sccMsgRelseNmbr
DEBUG 06/12/11 10:34:liquibase: Could not find table or view sccSCMCtrl for column sccUsmUserNmbr
DEBUG 06/12/11 10:34:liquibase: Could not find table or view sccSCMCtrl for column sccEarliestOpenAcctngMonth
DEBUG 06/12/11 10:34:liquibase: Could not find table or view sccSCMCtrl for column sccMsgAcctngMonth
DEBUG 06/12/11 10:34:liquibase: Could not find table or view sccSCMCtrl for column sccMonthEndDate
DEBUG 06/12/11 10:34:liquibase: Could not find table or view sccSCMCtrl for column sccDateLoadComplt
—etc for each table in the SCM schema. 

Ah, DBA’s given me wrong table permissions - now all working correctly.  Very sorry, thanks for the reply.