Open maciej opened 1 month ago
Yeah if the table has just been created it won't matter since there's no data
If you wrap your migration in a transaction squawk won't warn:
begin;
create table if not exists customer
(
email text
);
create unique index if not exists idx_custome_email on customer (email);
commit;
Currently if even if an index is created directly after the table it refers to
require-concurrent-index-creation
will be triggered. Index creation on an empty table is virtually instantaneous and locking a table that is unlikely to receive writes until the migration script finishes seems like a non-issue to me.Example migrate script:
squawk output:
I'd suggest relaxing the rule in cases where tables and their indexes are created in the same file.