This commit is contained in:
dpurbosakti
2025-08-15 12:12:33 +07:00
parent 61d0f91c3f
commit db6af776a3
4 changed files with 65 additions and 4 deletions
+2 -1
View File
@@ -9,10 +9,11 @@ data "external_schema" "gorm" {
env "gorm" {
src = data.external_schema.gorm.url
dev = "postgres://moko:password@localhost:5432/simrs_vx1?sslmode=disable"
dev = "postgres://moko:password@localhost:5432/simrs_vx3?sslmode=disable"
migration {
dir = "file://migrations"
}
url = "postgres://moko:password@localhost:5432/simrs_vx1?sslmode=disable"
format {
migrate {
diff = "{{ sql . \" \" }}"
+22
View File
@@ -0,0 +1,22 @@
data "external_schema" "gorm" {
program = [
"go",
"run",
"-mod=mod",
".",
]
}
env "gorm" {
src = data.external_schema.gorm.url
dev = "" // dsn db to check the diff
migration {
dir = "file://migrations"
}
url = "" // dsn db to apply
format {
migrate {
diff = "{{ sql . \" \" }}"
}
}
}