Open PythonCoderAS opened 3 years ago
I had to modify the original SQL to this:
async def upgrade(db: BaseDBAsyncClient) -> str:
return """
CREATE UNIQUE INDEX "uid_statistic_channel_f53e9b" ON "statistic" ("channel_id", "thread_id", "author_id", "month");
ALTER TABLE "statistic" DROP CONSTRAINT "uid_statistic_channel_3743df";"""
async def downgrade(db: BaseDBAsyncClient) -> str:
return """
ALTER TABLE "statistic" ADD CONSTRAINT "uid_statistic_channel_3743df" UNIQUE ("channel_id", "thread_id", "author_id");
DROP INDEX "uid_statistic_channel_f53e9b";"""
If a migration containing a "DROP INDEX" command with a unique index is executed on PostgreSQL, an error is raised, claiming