Migration and existing policy issues
When I run migrations, it fails to execute cause it says " applying migrations...PostgresError: policy 'foo' for table 'bar' already exists".
First migration was fine, but now, every time I try to add a new migration file it fails on that.
Ideas on how to go around it?
I'm using postgres on supabase with RLS.
5 Replies
Hey @ar7casper. I think you can add
create if not exists
to your migration
smth like this
create if not exists 'foo'>
Hey Mykhailo, thank you, this resolved my issue as well. Should drizzle generate this " IF NOT EXISTS" statement in migration sql directly? I feel this is helpful in many scenarios.
@Qing @ quotion.co Can you drop your statement? Something's off
Hey @Qing @ quotion.co, as of now, Drizzle does not generate the 'IF NOT EXISTS' statement in migration SQL directly. However, in the future, there will be an option to generate SQL with or without the 'IF NOT EXISTS' statement.
Thanks, that would be perfect fine.