From 7a72550614ccb1500223dddf537e924df008ecf2 Mon Sep 17 00:00:00 2001 From: Maxim Korolyov Date: Wed, 21 Jun 2023 21:55:23 +0200 Subject: [PATCH] add tests for scylladb. add scylladb to docs --- README.md | 1 + database/cassandra/README.md | 5 +++-- database/cassandra/cassandra_test.go | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3beed0076..ce4df2367 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Database drivers run migrations. [Add a new database?](database/driver.go) * [Redshift](database/redshift) * [Ql](database/ql) * [Cassandra](database/cassandra) +* [ScyllaDB](database/cassandra) * [SQLite](database/sqlite) * [SQLite3](database/sqlite3) ([todo #165](https://github.com/mattes/migrate/issues/165)) * [SQLCipher](database/sqlcipher) diff --git a/database/cassandra/README.md b/database/cassandra/README.md index 65ab0e62c..5cec0ab66 100644 --- a/database/cassandra/README.md +++ b/database/cassandra/README.md @@ -1,11 +1,12 @@ -# Cassandra +# Cassandra / ScyllaDB * Drop command will not work on Cassandra 2.X because it rely on -system_schema table which comes with 3.X +system_schema table which comes with 3.X. Works as expected for ScyllaDB. * Other commands should work properly but are **not tested** * 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: * 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. * The queries are not executed in any sort of transaction/batch, meaning you are responsible for fixing partial migrations. +* For ScyllaDB no additional configuration required as it is a drop-in replacement for Cassandra. ## Usage diff --git a/database/cassandra/cassandra_test.go b/database/cassandra/cassandra_test.go index 2e0c40283..87d21d9a1 100644 --- a/database/cassandra/cassandra_test.go +++ b/database/cassandra/cassandra_test.go @@ -25,9 +25,11 @@ var ( // Although Cassandra 2.x is supported by the Apache Foundation, // the migrate db driver only supports Cassandra 3.x since it uses // the system_schema keyspace. + // last ScyllaDB version tested is 5.1.11 specs = []dktesting.ContainerSpec{ {ImageName: "cassandra:3.0", Options: opts}, {ImageName: "cassandra:3.11", Options: opts}, + {ImageName: "scylladb/scylla:5.1.11", Options: opts}, } )