File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff 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'
Original file line number Diff line number Diff 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'
You can’t perform that action at this time.
0 commit comments