Skip to content

Commit 6e02eed

Browse files
committed
fix(ci): ddl apply
1 parent baebc5b commit 6e02eed

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docker/docker-compose-debug.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ services:
1919
volumes:
2020
- ./data/mysql:/var/lib/mysql
2121
- ./volumes/mysql/schema.sql:/docker-entrypoint-initdb.d/init.sql
22-
- ./atlas/migrations:/atlas-migrations:ro
22+
- ./atlas/opencoze_latest_schema.hcl:/opencoze_latest_schema.hcl:ro
2323
entrypoint:
2424
- bash
2525
- -c
@@ -54,10 +54,10 @@ services:
5454
echo 'Atlas CLI already installed'
5555
fi
5656

57-
if [ -d '/atlas-migrations' ] && [ "$$(ls -A /atlas-migrations)" ]; then
57+
if [ -f '/opencoze_latest_schema.hcl' ]; then
5858
echo 'Running Atlas migrations...'
5959
ATLAS_URL="mysql://$${MYSQL_USER}:$${MYSQL_PASSWORD}@localhost:3306/$${MYSQL_DATABASE}"
60-
atlas migrate apply --url "$$ATLAS_URL" --dir "file:///atlas-migrations" --allow-dirty
60+
atlas schema apply -u "$ATLAS_URL" --to "file:///opencoze_latest_schema.hcl" --exclude "atlas_schema_revisions,table_*" --auto-approve
6161
echo 'Atlas migrations completed successfully'
6262
else
6363
echo 'No migrations found'

docker/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ services:
5353
echo 'Atlas CLI already installed'
5454
fi
5555

56-
if [ -d '/atlas-migrations' ] && [ "$$(ls -A /atlas-migrations)" ]; then
56+
if [ -f '/opencoze_latest_schema.hcl' ]; then
5757
echo 'Running Atlas migrations...'
5858
ATLAS_URL="mysql://$${MYSQL_USER}:$${MYSQL_PASSWORD}@localhost:3306/$${MYSQL_DATABASE}"
59-
atlas schema apply -u "$ATLAS_URL" --to "file:///opencoze_latest_schema.hcl" --auto-approve
59+
atlas schema apply -u "$ATLAS_URL" --to "file:///opencoze_latest_schema.hcl" --exclude "atlas_schema_revisions,table_*" --auto-approve
6060
echo 'Atlas migrations completed successfully'
6161
else
6262
echo 'No migrations found'

0 commit comments

Comments
 (0)