From f8e0d07236079de7a23506d4c5aed58482ec16d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Sat, 16 Sep 2017 19:35:50 +0200 Subject: [PATCH] avoid sql error when updating sql database The index doesn't exist in version 1.7.6 and so trying to drop it would lead to an error, resulting in not being able to import 1.7.6 database. https://github.com/iSoron/uhabits/issues/327 --- uhabits-core/src/main/resources/migrations/22.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uhabits-core/src/main/resources/migrations/22.sql b/uhabits-core/src/main/resources/migrations/22.sql index 0417119f9..1d1ffcf9a 100644 --- a/uhabits-core/src/main/resources/migrations/22.sql +++ b/uhabits-core/src/main/resources/migrations/22.sql @@ -13,7 +13,7 @@ begin transaction; habit integer not null references habits(id), timestamp integer not null, value integer not null); - drop index idx_repetitions_habit_timestamp; + drop index if exists idx_repetitions_habit_timestamp; create unique index idx_repetitions_habit_timestamp on Repetitions( habit, timestamp); insert into Repetitions select * from RepetitionsBak;