ariga / atlas

Manage your database schema as code
https://atlasgo.io
Apache License 2.0
5.64k stars 251 forks source link

Postgres: inspect: for foreign key deferrable initially deferred #2367

Open alexisvisco opened 8 months ago

alexisvisco commented 8 months ago

Hello, seeing that a diff is generating this (using postgres)

ALTER TABLE "public"."order_items" ADD
 CONSTRAINT "fk_order_items_order_id" FOREIGN KEY ("order_id") REFERENCES "public"."orders" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION;

While I have set this in the schema .sql :

constraint fk_order_items_order_id foreign key (order_id) references orders (id) deferrable initially deferred

I would like to contribute opening a PR :

Seems like this codes need to be impacted :

Could you give me some hint so that I can open a pull request ?

Thanks you :)

C-Deck commented 2 months ago

This commit adds the inspect/diff pieces you may need. I'm not familiar with the tooling functionality that atlas does since I use this package like Ent does. If support in the tooling is needed to merge this, someone else will have to take over.