golang-migrate / migrate

Database migrations. CLI and Golang library.
Other
15.14k stars 1.39k forks source link

Scylla: error: no migration found for version 0: read down for version 0 #1100

Open AugustDev opened 4 months ago

AugustDev commented 4 months ago

Describe the Bug Executing migration for scylla returns an error error: no migration found for version 0: read down for version 0

Steps to Reproduce

  1. Generate migration files
    migrate create -ext cql -dir ./db -seq init

    This creates new files

    db/000001_init.up.cql
    db/000001_init.down.cql
  2. Add schema to 000001_init.up.cql
    CREATE TABLE notebooks(
    id TEXT PRIMARY KEY,
    name TEXT,
    description TEXT,
    created_at TIMESTAMP,
    );
  3. Run migration Make sure product keyspace exists in the database.
    migrate -database 'cassandra://localhost:9042/product' -path ./db up

    which returns an error

error: no migration found for version 0: read down for version 0 .: file does not existerror: no migration found for version 0: read down for version 0 .: file does not exist
make: *** [migrate] Error 1

Expected behaviour is for migrations to be applied and table created.

Migrate Version v4.17.1 Obtained by running: migrate -version

Loaded Source Drivers Source drivers: go-bindata, github, gitlab, bitbucket, gcs, file, github-ee, godoc-vfs, s3 Obtained by running: migrate -help

Loaded Database Drivers Database drivers: cassandra, crdb-postgres, postgres, ysql, mongodb, spanner, stub, clickhouse, pgx4, firebirdsql, rqlite, pgx, postgresql, redshift, yugabyte, yugabytedb, neo4j, mongodb+srv, sqlserver, mysql, pgx5, cockroach, cockroachdb, firebird

Go Version go version go1.22.2 darwin/arm64