Try to drop identity in addition to default and id_seq in puppet/bot_chat tables

Closes #720
Closes #721

Co-authored-by: Carl Ambroselli <git@carl-ambroselli.de>
This commit is contained in:
Tulir Asokan
2021-12-29 12:47:32 +02:00
parent 2a1e5c9d1e
commit aae8f78cb4
@@ -73,10 +73,12 @@ async def migrate_legacy_to_v1(conn: Connection, scheme: str) -> None:
ON UPDATE CASCADE ON DELETE SET NULL ON UPDATE CASCADE ON DELETE SET NULL
""" """
) )
await conn.execute("ALTER TABLE puppet ALTER COLUMN id DROP IDENTITY IF EXISTS")
await conn.execute("ALTER TABLE puppet ALTER COLUMN id DROP DEFAULT") await conn.execute("ALTER TABLE puppet ALTER COLUMN id DROP DEFAULT")
await conn.execute("DROP SEQUENCE puppet_id_seq") await conn.execute("DROP SEQUENCE IF EXISTS puppet_id_seq")
await conn.execute("ALTER TABLE bot_chat ALTER COLUMN id DROP IDENTITY IF EXISTS")
await conn.execute("ALTER TABLE bot_chat ALTER COLUMN id DROP DEFAULT") await conn.execute("ALTER TABLE bot_chat ALTER COLUMN id DROP DEFAULT")
await conn.execute("DROP SEQUENCE bot_chat_id_seq") await conn.execute("DROP SEQUENCE IF EXISTS bot_chat_id_seq")
await conn.execute("ALTER TABLE portal ALTER COLUMN config TYPE jsonb USING config::jsonb") await conn.execute("ALTER TABLE portal ALTER COLUMN config TYPE jsonb USING config::jsonb")
await conn.execute( await conn.execute(
"ALTER TABLE telegram_file ALTER COLUMN decryption_info TYPE jsonb " "ALTER TABLE telegram_file ALTER COLUMN decryption_info TYPE jsonb "