From 0c4a2a336d8a2442624592d4dc37e9153edfa87f Mon Sep 17 00:00:00 2001 From: Vincent Guerci Date: Mon, 2 Sep 2019 10:52:52 +0200 Subject: [PATCH] [timeseries] DROP timeseries_state PK if it exists (#454) As some previous migration feature might left one, causing rare crashes where a backfill collide with normal state updates --- .../src/main/scala/com/criteo/cuttle/timeseries/Database.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/timeseries/src/main/scala/com/criteo/cuttle/timeseries/Database.scala b/timeseries/src/main/scala/com/criteo/cuttle/timeseries/Database.scala index 5f992d799..e1c06be9e 100644 --- a/timeseries/src/main/scala/com/criteo/cuttle/timeseries/Database.scala +++ b/timeseries/src/main/scala/com/criteo/cuttle/timeseries/Database.scala @@ -86,7 +86,8 @@ private[timeseries] object Database { CREATE INDEX timeseries_backfills_by_status ON timeseries_backfills (status); """.update.run, contextIdMigration, - NoUpdate // We removed this migration, so we reserve this slot + NoUpdate, // We removed this migration, so we reserve this slot + sql"DROP INDEX IF EXISTS `PRIMARY` ON timeseries_state".update.run ) val doSchemaUpdates: ConnectionIO[Unit] = utils.updateSchema("timeseries", schema)