Skip to content

Commit 893254f

Browse files
Reorder migrations
1 parent 6523fac commit 893254f

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/ci_census.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,22 @@ jobs:
6868
bundle exec rake test_app
6969
cd spec/decidim_dummy_app/
7070
bundle exec rails decidim_census:install:migrations
71+
72+
- name: Ensure pgcrypto migration runs first
73+
run: |
74+
MIGRATION_FILE=$(find db/migrate -name '*enable_pgcrypto*' | head -1)
75+
if [ -n "$MIGRATION_FILE" ]; then
76+
DIR=$(dirname "$MIGRATION_FILE")
77+
DESCRIPTION=$(basename "$MIGRATION_FILE" | sed 's/^[0-9]*//')
78+
mv "$MIGRATION_FILE" "${DIR}/00000000000001${DESCRIPTION}"
79+
echo "Renamed to: ${DIR}/00000000000001${DESCRIPTION}"
80+
else
81+
echo "WARNING: pgcrypto migration not found!"
82+
exit 1
83+
fi
84+
85+
- name: Run migrations
86+
run: |
7187
RAILS_ENV=test bundle exec rails db:migrate
7288
7389
- name: Run RSpec

0 commit comments

Comments
 (0)