Generation of empty changelog

Hello,


I’m a new user.

I’ve got an existing database (MS SQL Server 2008 R2), I’m trying to generate the first change log, but the generated file is empty.


I’ve launched the following command:

liquibase  --logLevel=debug --changeLogFile="./changelog.xml" generateChangeLog


And here is the output I have:


DEBUG 12/05/14 17:05:liquibase: Connected to xxxxx@jdbc:sqlserver://xxxx:1433;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustServerCertificate=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;packetSize=8000;multiSubnetFailover=false;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=xxxx;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite;

DEBUG 12/05/14 17:05:liquibase: Setting auto commit to false from true

DEBUG 12/05/14 17:05:liquibase: Executing QUERY database command: select schema_name()

DEBUG 12/05/14 17:05:liquibase: Executing QUERY database command: SELECT CONVERT(varchar(100), SERVERPROPERTY(‘COLLATION’))

INFO 12/05/14 17:05:liquibase: .\changelog.xml does not exist, creating

DEBUG 12/05/14 17:05:liquibase: MissingObjectChangeGenerator type order:     liquibase.structure.core.Catalog    liquibase.structure.core.Schema    liquibase.structure.core.Sequence    liquibase.structure.core.StoredProcedure    liquibase.structure.core.Table    liquibase.structure.core.Column    liquibase.structure.core.PrimaryKey    liquibase.structure.core.ForeignKey    liquibase.structure.core.UniqueConstraint    liquibase.structure.core.Index    liquibase.structure.core.View

DEBUG 12/05/14 17:05:liquibase: UnexpectedObjectChangeGenerator type order:     liquibase.structure.core.Catalog    liquibase.structure.core.ForeignKey    liquibase.structure.core.Schema    liquibase.structure.core.StoredProcedure    liquibase.structure.core.UniqueConstraint    liquibase.structure.core.View    liquibase.structure.core.Table    liquibase.structure.core.PrimaryKey    liquibase.structure.core.Column    liquibase.structure.core.Index    liquibase.structure.core.Sequence

DEBUG 12/05/14 17:05:liquibase: ChangedObjectChangeGenerator type order:     liquibase.structure.core.Catalog    liquibase.structure.core.ForeignKey    liquibase.structure.core.Schema    liquibase.structure.core.Sequence    liquibase.structure.core.StoredProcedure    liquibase.structure.core.Table    liquibase.structure.core.Column    liquibase.structure.core.PrimaryKey    liquibase.structure.core.Index    liquibase.structure.core.UniqueConstraint    liquibase.structure.core.View

Liquibase ‘generateChangeLog’ Successful


And here is the generated changelog.xml:


<?xml version="1.0" encoding="UTF-8" standalone="no"?>


User used to connect is database owner.


Any idea what’s wrong?


Are there multiple databases and/or schemas on that server? It appears that Liquibase is getting information for a different database or schema than what you are expecting. 

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Yes, multiple databases and multiple schema per database.


I’ve put the databaseName in the parameter of the connection url, but didn’t specify the schema anywhere.


From what I found it’s possible to specify a schema in the url as well, but I’m guessing only one.

Is there any way to tell liquibase to scan multiple schema?


While I’m on schemas, is there also a way to specify in which schema liquibase will put it’s tables, or will it be the one specified in the connection url as well?


Thanks,

Nicolas.

Nothing to specify the schema on the connection url worked.


However the command line defaultSchemaName parameter did the job.

The database I’m currently working on does only have one schema, so this was enough.


I guess that when I will move to the other database I will have to generate multiple change logs and merge them manually.


Regarding schema, I also found the option changelogSchemaName which was helpful.