File tree Expand file tree Collapse file tree 5 files changed +35
-2
lines changed
Expand file tree Collapse file tree 5 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -206,4 +206,4 @@ Temporary Items
206206* .sqlite-journal
207207* .sqlite3-journal
208208* .db-journal
209- * .sql
209+ analyze .sql
Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ atlas schema inspect -u "postgres://app_user:change_this_password@localhost:5432
1818atlas schema apply --url " sqlite://issues.db" --to " file://migrate.sql" --dev-url " sqlite://file?mode=memory" --dry-run
1919atlas schema apply --url " sqlite://issues.db" --to " file://migrate.sql" --dev-url " sqlite://file?mode=memory"
2020
21- atlas schema apply --url " postgres://app_user:change_this_password@localhost:5432/app_database?sslmode=disable" --to " file://migrate.sql" --dev-url " docker://postgres/17" --dry-run
21+ atlas schema apply --url " postgres://app_user:change_this_password@localhost:5432/app_database?sslmode=disable" --to " file://./migrations/migrate.sql" --dev-url " docker://postgres/17" --dry-run
22+ atlas schema apply --url " postgres://app_user:change_this_password@localhost:5432/app_database?sslmode=disable" --to " file://./migrations/migrate.sql" --dev-url " docker://postgres/17"
2223```
2324
2425``` mermaid
Original file line number Diff line number Diff line change @@ -27,9 +27,28 @@ services:
2727 networks :
2828 - app_network
2929
30+ atlas :
31+ image : arigaio/atlas:latest
32+ container_name : atlas_migrations
33+ depends_on :
34+ db :
35+ condition : service_healthy
36+ env_file :
37+ - .env
38+ volumes :
39+ - ./migrations:/migrations
40+ command : >
41+ migrate apply
42+ --url "postgres://${POSTGRES_SUPER_USER}:${POSTGRES_SUPER_PASSWORD}@db:5432/${POSTGRES_DB}?sslmode=disable"
43+ --dir "file:///migrations"
44+ networks :
45+ - app_network
46+
3047volumes :
3148 postgres_data :
3249 name : postgres_data
50+ postgres_data_dev :
51+ name : postgres_data_dev
3352
3453networks :
3554 app_network :
Original file line number Diff line number Diff line change 1+ h1:Ey773GArjuY1VXrV0JPiw735MWDy1WliOVfb9GTgp6I=
2+ migrate.sql h1:QcfhJKGaQInbgbjFZCIgva/1LxeC8HjdFVZtPoWbvyA=
Original file line number Diff line number Diff line change 1+ -- Create the schema
2+ CREATE SCHEMA IF NOT EXISTS " issue_analysis" ;
3+
4+ -- Create "issue" table in the issue_analysis schema
5+ CREATE TABLE "issue_analysis "." issue" (
6+ " version" integer NOT NULL ,
7+ " issue_number" integer NOT NULL ,
8+ " issue_state" varchar NOT NULL ,
9+ PRIMARY KEY (" issue_number" )
10+ );
11+
You can’t perform that action at this time.
0 commit comments