You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the documentation empty migrations is permitted by migrate (see here)
The migration files are permitted to be "empty", in the event that a migration is a no-op or is irreversible. It is recommended to still include both migration files by making the whole migration file consist of a comment. If your database does not support comments, then deleting the migration file will also work. Note, an actual empty file (e.g. a 0 byte file) may cause issues with your database since migrate will attempt to run an empty query. In this case, deleting the migration file will also work. For the rational of this behavior see: #244 (comment)
It seems for clickhouse that having a file with just a comment still causes an empty query error:
error: migration failed in line 0: (details: code: 62, message: Empty query)
Steps to Reproduce
Steps to reproduce the behavior:
Create a new clickhouse DB migration, leaving the up migration file empty.
$ migrate -ext migrations -dir migrations empty_up_test
$ echo "-- Empty file, because we need multiple down migrations to under the next up migration" > migrations/2020904120200_empty_up_test.migration
Perform the up migration:
$ migrate -path migrations -source "${MIGRATE_DB}" up
See error
Expected Behavior
I would expect that a up migration file with an empty script would simply update the schema_migrations table to the new version
It looks like Clickhouse doesn't support empty queries or queries with only comments. There's nothing actionable for migrate since migrate avoids processing or interpreting migration data/content. e.g. migration content/data is treated as opaque binary blobs
See: #244 (comment)
I find it odd that you're getting the same 1065 MySQL/MariaDB error in Clickhouse
According to the documentation empty migrations is permitted by migrate (see here)
It seems for clickhouse that having a file with just a comment still causes an empty query error:
Steps to Reproduce
Steps to reproduce the behavior:
Expected Behavior
I would expect that a up migration file with an empty script would simply update the schema_migrations table to the new version
Migrate Version
4.12.2
Loaded Source Drivers
github, github-ee, gitlab, go-bindata, godoc-vfs, gcs, file, s3
Loaded Database Drivers
cockroachdb, firebird, mysql, sqlserver, cassandra, firebirdsql, redshift, spanner, neo4j, postgres, postgresql, clickhouse, cockroach, crdb-postgres, mongodb, mongodb+srv, stub
Go Version
go version go1.14.4 linux/amd64
The text was updated successfully, but these errors were encountered: