From b870d9c594a1c827fcd03cbdf7e1c9d9f5a0ad34 Mon Sep 17 00:00:00 2001 From: asm0dey Date: Sun, 27 Aug 2023 11:04:50 +0200 Subject: [PATCH] Adds index on book.sequence to make the migration faster --- build.gradle.kts | 2 +- src/flyway/resources/db/migration/V6__sequence_ids.sql | 3 +++ versions.properties | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 14869c6..d0b74ed 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,7 +13,7 @@ plugins { } group = "io.github.asm0dey" -version = "0.1.4" +version = "0.1.5" application { mainClass.set("io.github.asm0dey.ApplicationKt") diff --git a/src/flyway/resources/db/migration/V6__sequence_ids.sql b/src/flyway/resources/db/migration/V6__sequence_ids.sql index b8d27f3..84c3b79 100644 --- a/src/flyway/resources/db/migration/V6__sequence_ids.sql +++ b/src/flyway/resources/db/migration/V6__sequence_ids.sql @@ -1,6 +1,9 @@ ALTER TABLE book ADD COLUMN seqid INT; +CREATE INDEX book_sequence_index + ON book (sequence); + UPDATE book SET seqid=numbers.seqrow FROM (SELECT ROW_NUMBER() OVER () seqrow, seqname diff --git a/versions.properties b/versions.properties index 9391f60..df7e078 100644 --- a/versions.properties +++ b/versions.properties @@ -1,5 +1,5 @@ #### Dependencies and Plugin versions with their available updates. -#### Generated by `./gradlew refreshVersions` version 0.60.0 +#### Generated by `./gradlew refreshVersions` version 0.60.1 #### #### Don't manually edit or split the comments that start with four hashtags (####), #### they will be overwritten by refreshVersions.