| 2 | |
| 3 | Output with that project: |
| 4 | |
| 5 | {{{ |
| 6 | #!sql |
| 7 | $ ./tp3/manage.py sqlmigrate a 0001 |
| 8 | BEGIN; |
| 9 | -- |
| 10 | -- Create model B |
| 11 | -- |
| 12 | CREATE TABLE "a_b" ("id" serial NOT NULL PRIMARY KEY); |
| 13 | -- |
| 14 | -- Create model C |
| 15 | -- |
| 16 | CREATE TABLE "a_c" ("id" serial NOT NULL PRIMARY KEY, "b_id" integer NOT NULL); |
| 17 | ALTER TABLE "a_c" ADD CONSTRAINT "a_c_b_id_5a026661_fk_a_b_id" FOREIGN KEY ("b_id") REFERENCES "a_b" ("id") DEFERRABLE INITIALLY DEFERRED; |
| 18 | CREATE INDEX "a_c_b_id_5a026661" ON "a_c" ("b_id"); |
| 19 | COMMIT; |
| 20 | }}} |
| 21 | |
| 22 | |
| 23 | {{{ |
| 24 | #!sql |
| 25 | $ ./tp3/manage.py sqlmigrate a 0002 |
| 26 | BEGIN; |
| 27 | -- |
| 28 | -- Alter field b on c |
| 29 | -- |
| 30 | COMMIT; |
| 31 | }}} |