From eea6aa5c642f1fb0d191ab1edb1097d6e475e11b Mon Sep 17 00:00:00 2001 From: Zach Wasserman Date: Wed, 18 Nov 2020 11:44:06 -0800 Subject: [PATCH] Fix unexpected print of migration status warning (#50) Replace the now-deleted migration server/datastore/mysql/migrations/data/20181119180000_DeleteSoftDeletedEntities.go with a new migration containing the same timestamp. This allows Fleet to see the appropriate migration state for users upgrading from previous versions without actually modifying the DB. Fixes #48 --- .../data/20181119180000_Placeholder.go | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 server/datastore/mysql/migrations/data/20181119180000_Placeholder.go diff --git a/server/datastore/mysql/migrations/data/20181119180000_Placeholder.go b/server/datastore/mysql/migrations/data/20181119180000_Placeholder.go new file mode 100644 index 0000000000..54a6ad84a4 --- /dev/null +++ b/server/datastore/mysql/migrations/data/20181119180000_Placeholder.go @@ -0,0 +1,24 @@ +package data + +import ( + "database/sql" +) + +// This migration exists as a "placeholder" to prevent the unexpected printing +// of a migration inconsistency warning on Fleet startup. The migration is +// intentionally empty. See https://github.com/fleetdm/fleet/issues/48 for more +// details. + +func init() { + MigrationClient.AddMigration(Up_20181119180000, Down_20181119180000) +} + +func Up_20181119180000(tx *sql.Tx) error { + // Intentional noop + return nil +} + +func Down_20181119180000(tx *sql.Tx) error { + // Intentional noop + return nil +}