...
1# Cassandra
2
3* Drop command will not work on Cassandra 2.X because it rely on
4system_schema table which comes with 3.X
5* Other commands should work properly but are **not tested**
6* The Cassandra driver (gocql) does not natively support executing multiple statements in a single query. To allow for multiple statements in a single migration, you can use the `x-multi-statement` param. There are two important caveats:
7 * This mode splits the migration text into separately-executed statements by a semi-colon `;`. Thus `x-multi-statement` cannot be used when a statement in the migration contains a string with a semi-colon.
8 * The queries are not executed in any sort of transaction/batch, meaning you are responsible for fixing partial migrations.
9
10
11## Usage
12`cassandra://host:port/keyspace?param1=value¶m2=value2`
13
14
15| URL Query | Default value | Description |
16|------------|-------------|-----------|
17| `x-migrations-table` | schema_migrations | Name of the migrations table |
18| `x-multi-statement` | false | Enable multiple statements to be ran in a single migration (See note above) |
19| `port` | 9042 | The port to bind to |
20| `consistency` | ALL | Migration consistency
21| `protocol` | | Cassandra protocol version (3 or 4)
22| `timeout` | 1 minute | Migration timeout
23| `username` | nil | Username to use when authenticating. |
24| `password` | nil | Password to use when authenticating. |
25| `sslcert` | | Cert file location. The file must contain PEM encoded data. |
26| `sslkey` | | Key file location. The file must contain PEM encoded data. |
27| `sslrootcert` | | The location of the root certificate file. The file must contain PEM encoded data. |
28| `sslmode` | | Whether or not to use SSL (disable\|require\|verify-ca\|verify-full) |
29| `disable-host-lookup`| false | Disable initial host lookup. |
30
31`timeout` is parsed using [time.ParseDuration(s string)](https://golang.org/pkg/time/#ParseDuration)
32
33
34## Upgrading from v1
35
361. Write down the current migration version from schema_migrations
372. `DROP TABLE schema_migrations`
384. Download and install the latest migrate version.
395. Force the current migration version with `migrate force <current_version>`.
View as plain text