Skip to content

Commit

Permalink
Adds index on book.sequence to make the migration faster
Browse files Browse the repository at this point in the history
  • Loading branch information
asm0dey committed Aug 27, 2023
1 parent 3a685dc commit b870d9c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {
}

group = "io.github.asm0dey"
version = "0.1.4"
version = "0.1.5"
application {
mainClass.set("io.github.asm0dey.ApplicationKt")

Expand Down
3 changes: 3 additions & 0 deletions src/flyway/resources/db/migration/V6__sequence_ids.sql
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion versions.properties
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit b870d9c

Please sign in to comment.