github.com/ldej/migrate@v3.5.4+incompatible/database/cassandra/README.md (about) 1 # Cassandra 2 3 * Drop command will not work on Cassandra 2.X because it rely on 4 system_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 multipe 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 26 27 `timeout` is parsed using [time.ParseDuration(s string)](https://golang.org/pkg/time/#ParseDuration) 28 29 30 ## Upgrading from v1 31 32 1. Write down the current migration version from schema_migrations 33 2. `DROP TABLE schema_migrations` 34 4. Download and install the latest migrate version. 35 5. Force the current migration version with `migrate force <current_version>`.