Skip to content

Commit 4fa4135

Browse files
committed
Create schema_migration Suprabase table manually in action workflow
1 parent 2dc0150 commit 4fa4135

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,12 @@ jobs:
211211
catalog_present=$(docker exec -e PGPASSWORD=postgres "${container_id}" psql -U postgres -d postgres -At -c "select to_regclass('supabase_migrations.schema_migrations');" || true)
212212
213213
if [ -z "${catalog_present}" ] || [ "${catalog_present}" = "" ] || [ "${catalog_present}" = "NULL" ]; then
214-
echo "supabase_migrations.schema_migrations missing; running supabase db reset"
215-
FORCE_COLOR=1 npx dotenv-cli -e test/containers/.env -- bash -c 'npx supabase db reset --local --workdir suprabase --yes --debug'
214+
echo "supabase_migrations.schema_migrations missing; creating manually"
215+
docker exec -e PGPASSWORD=postgres "${container_id}" psql -U postgres -d postgres -v ON_ERROR_STOP=1 -c "CREATE SCHEMA IF NOT EXISTS supabase_migrations;"
216+
docker exec -e PGPASSWORD=postgres "${container_id}" psql -U postgres -d postgres -v ON_ERROR_STOP=1 -c "CREATE TABLE IF NOT EXISTS supabase_migrations.schema_migrations (version text PRIMARY KEY, inserted_at timestamptz DEFAULT now());"
217+
echo "Catalog created; verifying contents"
218+
docker exec -e PGPASSWORD=postgres "${container_id}" psql -U postgres -d postgres -c "\\d supabase_migrations.schema_migrations"
219+
docker exec -e PGPASSWORD=postgres "${container_id}" psql -U postgres -d postgres -c "table supabase_migrations.schema_migrations"
216220
else
217221
echo "Catalog present: ${catalog_present}"
218222
fi

0 commit comments

Comments
 (0)