@@ -27,6 +27,53 @@ It supports both local development and cloud deployment with CI/CD workflows.
2727``` console
2828$ docker compose up -d --wait --quiet-pull db
2929$ docker compose run -it atlas schema inspect -u " postgres://user:pass@db:5432/local_db?sslmode=disable"
30+ ...
31+ $ docker compose run -it atlas schema apply -u " postgres://user:pass@db:5432/local_db?sslmode=disable" --file file://schema/schema.hcl --auto-approve
32+ [+] Creating 1/1
33+ ✔ Container bootstrapping-databases-for-local-and-prod-db-1 Running 0.0s
34+ Planning migration statements (2 in total):
35+
36+ -- create "papers" table:
37+ -> CREATE TABLE "public"."papers" (
38+ "id" serial NOT NULL,
39+ "title" character varying(255) NOT NULL,
40+ PRIMARY KEY ("id")
41+ );
42+ -- create "mentions" table:
43+ -> CREATE TABLE "public"."mentions" (
44+ "id" serial NOT NULL,
45+ "paper_id" integer NOT NULL,
46+ "document" text NOT NULL,
47+ PRIMARY KEY ("id"),
48+ CONSTRAINT "mentions_paper_fk" FOREIGN KEY ("paper_id") REFERENCES "public"."papers" ("id") ON DELETE CASCADE
49+ );
50+
51+ -------------------------------------------
52+
53+ Applying approved migration (2 statements in total):
54+
55+ -- create "papers" table
56+ -> CREATE TABLE "public"."papers" (
57+ "id" serial NOT NULL,
58+ "title" character varying(255) NOT NULL,
59+ PRIMARY KEY ("id")
60+ );
61+ -- ok (24.597527ms)
62+
63+ -- create "mentions" table
64+ -> CREATE TABLE "public"."mentions" (
65+ "id" serial NOT NULL,
66+ "paper_id" integer NOT NULL,
67+ "document" text NOT NULL,
68+ PRIMARY KEY ("id"),
69+ CONSTRAINT "mentions_paper_fk" FOREIGN KEY ("paper_id") REFERENCES "public"."papers" ("id") ON DELETE CASCADE
70+ );
71+ -- ok (5.336047ms)
72+
73+ -------------------------
74+ -- 10.896794ms
75+ -- 1 migration
76+ -- 2 sql statements
3077```
3178
3279## Production deployment
0 commit comments