Compare commits

...

3 Commits

Author SHA1 Message Date
6e02eed1c8 fix(ci): ddl apply 2025-08-29 16:52:57 +08:00
baebc5b148 fix(ci): remove 2025-08-29 16:05:53 +08:00
57ec89d4f3 fix(ci): mysql ddl apply 2025-08-29 16:04:29 +08:00
2 changed files with 6 additions and 6 deletions

View File

@ -19,7 +19,7 @@ services:
volumes:
- ./data/mysql:/var/lib/mysql
- ./volumes/mysql/schema.sql:/docker-entrypoint-initdb.d/init.sql
- ./atlas/migrations:/atlas-migrations:ro
- ./atlas/opencoze_latest_schema.hcl:/opencoze_latest_schema.hcl:ro
entrypoint:
- bash
- -c
@ -54,10 +54,10 @@ services:
echo 'Atlas CLI already installed'
fi
if [ -d '/atlas-migrations' ] && [ "$$(ls -A /atlas-migrations)" ]; then
if [ -f '/opencoze_latest_schema.hcl' ]; then
echo 'Running Atlas migrations...'
ATLAS_URL="mysql://$${MYSQL_USER}:$${MYSQL_PASSWORD}@localhost:3306/$${MYSQL_DATABASE}"
atlas migrate apply --url "$$ATLAS_URL" --dir "file:///atlas-migrations" --allow-dirty
atlas schema apply -u "$ATLAS_URL" --to "file:///opencoze_latest_schema.hcl" --exclude "atlas_schema_revisions,table_*" --auto-approve
echo 'Atlas migrations completed successfully'
else
echo 'No migrations found'

View File

@ -18,7 +18,7 @@ services:
volumes:
- ./data/mysql:/var/lib/mysql
- ./volumes/mysql/schema.sql:/docker-entrypoint-initdb.d/init.sql
- ./atlas/migrations:/atlas-migrations:ro
- ./atlas/opencoze_latest_schema.hcl:/opencoze_latest_schema.hcl:ro
entrypoint:
- bash
- -c
@ -53,10 +53,10 @@ services:
echo 'Atlas CLI already installed'
fi
if [ -d '/atlas-migrations' ] && [ "$$(ls -A /atlas-migrations)" ]; then
if [ -f '/opencoze_latest_schema.hcl' ]; then
echo 'Running Atlas migrations...'
ATLAS_URL="mysql://$${MYSQL_USER}:$${MYSQL_PASSWORD}@localhost:3306/$${MYSQL_DATABASE}"
atlas migrate apply --url "$$ATLAS_URL" --dir "file:///atlas-migrations" --allow-dirty
atlas schema apply -u "$ATLAS_URL" --to "file:///opencoze_latest_schema.hcl" --exclude "atlas_schema_revisions,table_*" --auto-approve
echo 'Atlas migrations completed successfully'
else
echo 'No migrations found'