New! – Spin up instant copies of your dev databases in the cloud for free Learn more

Flyway Documentation

Poll

CockroachDB

Supported Versions

  • 21.1
  • 21.0
  • 20.x
  • 19.x
  • 2.1
  • 2.0
  • 1.1

Support Level

Compatible
Certified
Guaranteed Flyway Teams

Support Level determines the degree of support available for this database (learn more).

Driver

URL format jdbc:postgresql://host:port/database
SSL support Yes
Ships with Flyway Command-line Yes
Maven Central coordinates org.postgresql:postgresql:42.2.5
Supported versions 9.3-1104-jdbc4 and later
Default Java class org.postgresql.Driver

SQL Script Syntax

Compatibility

  • DDL exported by pg_dump can be used unchanged in a Flyway migration.
  • Any CockroachDB sql script executed by Flyway, can be executed by the CockroachDB command-line tool and other PostgreSQL-compatible tools (after the placeholders have been replaced).

Example

/* Single line comment */
CREATE TABLE test_data (
 value VARCHAR(25) NOT NULL PRIMARY KEY
);


/*
Multi-line
comment
*/

-- Placeholder
INSERT INTO ${tableName} (name) VALUES ('Mr. T');

Limitations

  • No support for psql meta-commands with no JDBC equivalent like \set

Additional Information

  • See CockroachDB’s walkthrough on using Flyway here

SAP HANA