supabase / stripe-sync-engine

Sync your Stripe account to you Postgres database.
https://supabase.com
Apache License 2.0
491 stars 49 forks source link

0012_add_updated_at.sql hardcodes role name to postgres #77

Open dthakur opened 1 year ago

dthakur commented 1 year ago

https://github.com/supabase/stripe-sync-engine/blob/2c0d81aaf877af018d1d4f103459e24cffebeca2/db/migrations/0012_add_updated_at.sql#L11

If the database does not have a postgres role, the migration fails.

/app/node_modules/pg-node-migrations/dist/migrate.js:108
            const error = new Error(`Migration failed. Reason: ${e.message}`);
                          ^

Error: Migration failed. Reason: An error occurred running 'add_updated_at'. Rolled back this migration. No further migrations were run. Reason: role "postgres" does not exist
yinghaochan commented 1 month ago
# shell
sed -i -e '/owner to postgres/d' db/migrations/0012_add_updated_at.sql && npm start
# docker run
/bin/sh -c "sed -i -e '/owner to postgres/d' db/migrations/0012_add_updated_at.sql && npm start"

overwrote the docker run command to remove that line.