-
Notifications
You must be signed in to change notification settings - Fork 68
/
atlas.hcl
98 lines (80 loc) · 2.14 KB
/
atlas.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
env "local" {
src = "${local.schema_src}"
migration {
dir = "${local.migrations_dir}"
format = "${local.migrations_format}"
}
format {
migrate {
diff = "{{ sql . \" \" }}"
}
}
url = "${local.local_url}"
// Define the URL of the Dev Database for this environment
// See: https://atlasgo.io/concepts/dev-database
dev = "docker://postgres/15/dev?search_path=public"
lint {
// Lint the effects of the 100 latest migration files
latest = 100
}
}
env "ci" {
src = "${local.schema_src}"
migration {
dir = "${local.migrations_dir}"
format = "${local.migrations_format}"
}
format {
migrate {
diff = "{{ sql . \" \" }}"
}
}
dev = "${local.ci_url}"
}
// CAN be used for all remote deployments
env "remote" {
src = "${local.schema_src}"
migration {
// Define the directory where the migrations are stored.
dir = "file://tools/migrate/migrations"
// We use golang-migrate
format = "${local.migrations_format}"
// Remote deployments already had auto deploy present
baseline = "${local.init_migration_ts}"
}
format {
migrate {
diff = "{{ sql . \" \" }}"
}
}
// Define the URL of the Dev Database for this environment
// See: https://atlasgo.io/concepts/dev-database
dev = "docker://postgres/15/dev?search_path=public"
}
locals {
// Define the directory where the schema definition resides.
schema_src = "ent://openmeter/ent/schema"
// Define the initial migration timestamp
init_migration_ts = "20240826120919"
// Define the directory where the migrations are stored.
migrations_dir = "file://tools/migrate/migrations"
// We use golang-migrate
migrations_format = "golang-migrate"
// Define common connection URLs
local_url = "postgres://postgres:postgres@localhost:5432/postgres?search_path=public&sslmode=disable"
ci_url = "postgres://postgres:postgres@postgres:5432/postgres?search_path=public&sslmode=disable"
}
lint {
non_linear {
error = true
}
destructive {
error = false
}
data_depend {
error = true
}
incompatible {
error = true
}
}