Skip to content

Instantly share code, notes, and snippets.

@luhn

luhn/README.md Secret

Created January 31, 2024 18:51
Show Gist options
  • Save luhn/7688fb2545bb7bab59c4d7cd02ff3d15 to your computer and use it in GitHub Desktop.
Save luhn/7688fb2545bb7bab59c4d7cd02ff3d15 to your computer and use it in GitHub Desktop.
Flyway bug repro

Flyway bug repro

To reproduce, clone this gist and then execute:

docker-compose up -d
flyway migrate

You'll see the output:

Flyway OSS Edition 10.7.1 by Redgate

See release notes here: https://rd.gt/416ObMi
Database: jdbc:postgresql://localhost:8080/postgres (PostgreSQL 16.1)
Schema history table "public"."flyway_schema_history" does not exist yet
Successfully validated 2 migrations (execution time 00:00.015s)
Creating Schema History table "public"."flyway_schema_history" ...
Current version of schema "public": << Empty Schema >>
Migrating schema "public" to version "1 - table"
Migrating schema "public" to version "2 - index" [non-transactional]

At this point flyway will hang forever.

services:
postgres:
image: "postgres:16"
ports:
- "8080:5432"
environment:
POSTGRES_HOST_AUTH_METHOD: trust
flyway.url=jdbc:postgresql://localhost:8080/postgres
flyway.user=postgres
flyway.password=
flyway.locations=filesystem:.
flyway.postgresql.transactional.lock=false # Issue with CREATE INDEX CONCURRENTLY
create table test(
id integer generated always as identity primary key,
name text not null
);
create index concurrently test_index on test(id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment