Skip to content

Improvement : ability to split DDL in the same file without triggering warnings #703

@swann-castel

Description

@swann-castel

My workflow is generating SQL migration using Prisma.

When creating a new table with a foreign key, Prisma creates a table CREATE TABLE table_name (id UUID NOT NULL, foreign_id UUID NOT NULL) and then create another DDL in the same file ALTER TABLE table_name ADD CONSTRAINT "table_name_fkey" FOREIGN KEY ("foreign_id") REFERENCES "foreign_table" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;

Prisma does this for a good reason, some databases do not support foreign key definition in the create table DDL.

I would like to be able to split those DDL when the config assume_in_transaction is set to true.

It seems that require-concurrent-index-creation is using this behavior.

Many thanks

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions