-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: support for Liquibase #13991
Comments
+1 First issue I see is the postgresql driver for liquibase uses table spaces, which is far as i can see is not supported in cockroach, not that it needs to be.. just it will be a likely syntax error, for anyone trying to get it to work w/ both a real postgresql database and cockroach or least attempting to migrate. |
If it helps, I just gave it a quick shot with a development instance via <?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<changeSet id="1" author="bob">
<createTable tableName="department">
<column name="id" type="int">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="name" type="varchar(50)">
<constraints nullable="false"/>
</column>
<column name="active" type="boolean" defaultValueBoolean="true"/>
</createTable>
</changeSet>
</databaseChangeLog> With the following command line, the change set appears to be working with cockroach 1.0.1.
How cool is that?? Cheers! |
I'm sure there might some complications down the road creating indexes or other kinds of commands specific to PostgreSQL. I'll ping back if I run into issues. Thanks! |
Currently using liquibase and investigating cockroach - thus far there's been two main issues presenting:
In case it's helpful, here's a sanitised version of the full query generated: BEGIN
SELECT tc.CONSTRAINT_NAME into strict constraint_name
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc
WHERE CONSTRAINT_TYPE = 'PRIMARY KEY'
AND TABLE_NAME = 'myTable' AND TABLE_SCHEMA = 'mySchema';
EXECUTE 'alter table mySchema.myTable drop constraint ' || constraint_name;
END $$;] |
Issues I have seen trying to use liquibase: Changesets:
Database metadata:
|
So the reserved words query is halfway there. Cockroachdb 2.0 supports pg_get_keywords(), but string_agg is not yet supported but referenced in #10495 |
In general making sure all JDBC metadata queries in the postgres driver works, will help the effort as liquibase relies a lot on this metadata. |
Any updates on this? |
@patelh, @timveil has done some investigation on this and discovered that Liquibase support has drastically improved since the last time we commented on this issue. However, we still haven't figured out how to run comprehensive tests on our compatibility. I would recommend trying out CockroachDB with Liquibase on your application and reporting back. We'll be able to help more if you do that. Thanks! |
Also worth noting that Liquibase doesn't respect the order of primary keys on Postgres databases. Instead, it uses the order of columns in the table, so keep an eye out for that. |
@jordanlewis @awoods187 will do thanks! |
@rafiss, do you have a tracking issue for this one? I'm going to move it to the AppDev board, but feel free to close! |
Thanks Jordan. @vy-ton: we can use this to track any further issues as they come up. |
We should test out whether we work with Liquibase, which is a schema management tool along the same lines as Flyway, and determine how much work it would be to support if it doesn't work already.
Known issues:
The text was updated successfully, but these errors were encountered: