diff --git a/webapp/alembic/versions/0b7761d85555_repurposed_discordio_column_to_generic_.py b/webapp/alembic/versions/0b7761d85555_repurposed_discordio_column_to_generic_.py index 851b495..99e6a87 100644 --- a/webapp/alembic/versions/0b7761d85555_repurposed_discordio_column_to_generic_.py +++ b/webapp/alembic/versions/0b7761d85555_repurposed_discordio_column_to_generic_.py @@ -18,7 +18,7 @@ import sqlalchemy as sa def upgrade(): # ### commands auto generated by Alembic - please adjust! ### - op.alter_column('guilds', 'discordio', new_column_name='invite_link') + op.alter_column('guilds', 'discordio', new_column_name='invite_link', existing_type=sa.String(255)) # ### end Alembic commands ### diff --git a/webapp/alembic/versions/109a6025e9ec_renamed_webhook_icon_to_guest_icon.py b/webapp/alembic/versions/109a6025e9ec_renamed_webhook_icon_to_guest_icon.py index bb7d90e..f8e8d73 100644 --- a/webapp/alembic/versions/109a6025e9ec_renamed_webhook_icon_to_guest_icon.py +++ b/webapp/alembic/versions/109a6025e9ec_renamed_webhook_icon_to_guest_icon.py @@ -18,8 +18,8 @@ import sqlalchemy as sa def upgrade(): # ### commands auto generated by Alembic - please adjust! ### - op.alter_column('guilds', 'webhook_icon', new_column_name='guest_icon') - op.alter_column('cosmetics', 'webhook_icon', new_column_name='guest_icon') + op.alter_column('guilds', 'webhook_icon', new_column_name='guest_icon', existing_type=sa.String(255)) + op.alter_column('cosmetics', 'webhook_icon', new_column_name='guest_icon', existing_type=sa.String(255)) # ### end Alembic commands ### diff --git a/webapp/alembic/versions/dffebf852b41_updated_primary_keys_away_from_the_auto_.py b/webapp/alembic/versions/dffebf852b41_updated_primary_keys_away_from_the_auto_.py index 0ca2d23..376ef77 100644 --- a/webapp/alembic/versions/dffebf852b41_updated_primary_keys_away_from_the_auto_.py +++ b/webapp/alembic/versions/dffebf852b41_updated_primary_keys_away_from_the_auto_.py @@ -18,59 +18,79 @@ import sqlalchemy as sa def upgrade(): # ### commands auto generated by Alembic - please adjust! ### - op.execute("ALTER TABLE administrators ALTER COLUMN user_id TYPE BIGINT USING user_id::bigint") + op.alter_column("administrators", "user_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="user_id::bigint") + #op.execute("ALTER TABLE administrators ALTER COLUMN user_id TYPE BIGINT USING user_id::bigint") op.drop_column('administrators', 'id') op.execute("ALTER TABLE administrators ADD PRIMARY KEY (user_id);") op.execute("ALTER TABLE authenticated_users ALTER COLUMN client_id DROP DEFAULT") - op.execute("ALTER TABLE authenticated_users ALTER COLUMN client_id TYPE BIGINT USING client_id::bigint") + op.alter_column("authenticated_users", "client_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="client_id::bigint") + #op.execute("ALTER TABLE authenticated_users ALTER COLUMN client_id TYPE BIGINT USING client_id::bigint") op.execute("ALTER TABLE authenticated_users ALTER COLUMN guild_id DROP DEFAULT") - op.execute("ALTER TABLE authenticated_users ALTER COLUMN guild_id TYPE BIGINT USING guild_id::bigint") + op.alter_column("authenticated_users", "guild_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="guild_id::bigint") + #op.execute("ALTER TABLE authenticated_users ALTER COLUMN guild_id TYPE BIGINT USING guild_id::bigint") op.execute("ALTER TABLE cosmetics ALTER COLUMN user_id DROP DEFAULT") - op.execute("ALTER TABLE cosmetics ALTER COLUMN user_id TYPE BIGINT USING user_id::bigint") + op.alter_column("cosmetics", "user_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="user_id::bigint") + #op.execute("ALTER TABLE cosmetics ALTER COLUMN user_id TYPE BIGINT USING user_id::bigint") op.drop_column('cosmetics', 'id') op.execute("ALTER TABLE cosmetics ADD PRIMARY KEY (user_id);") op.execute("ALTER TABLE disabled_guilds ALTER COLUMN guild_id DROP DEFAULT") - op.execute("ALTER TABLE disabled_guilds ALTER COLUMN guild_id TYPE BIGINT USING guild_id::bigint") + op.alter_column("disabled_guilds", "guild_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="guild_id::bigint") + #op.execute("ALTER TABLE disabled_guilds ALTER COLUMN guild_id TYPE BIGINT USING guild_id::bigint") op.drop_column('disabled_guilds', 'id') op.execute("ALTER TABLE disabled_guilds ADD PRIMARY KEY (guild_id);") op.execute("ALTER TABLE guild_members ALTER COLUMN guild_id DROP DEFAULT") - op.execute("ALTER TABLE guild_members ALTER COLUMN guild_id TYPE BIGINT USING guild_id::bigint") + op.alter_column("guild_members", "guild_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="guild_id::bigint") + #op.execute("ALTER TABLE guild_members ALTER COLUMN guild_id TYPE BIGINT USING guild_id::bigint") op.execute("ALTER TABLE guild_members ALTER COLUMN user_id DROP DEFAULT") - op.execute("ALTER TABLE guild_members ALTER COLUMN user_id TYPE BIGINT USING user_id::bigint") + op.alter_column("guild_members", "user_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="user_id::bigint") + #op.execute("ALTER TABLE guild_members ALTER COLUMN user_id TYPE BIGINT USING user_id::bigint") op.execute("ALTER TABLE guilds ALTER COLUMN guild_id DROP DEFAULT") - op.execute("ALTER TABLE guilds ALTER COLUMN guild_id TYPE BIGINT USING guild_id::bigint") + op.alter_column("guilds", "guild_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="guild_id::bigint") + #op.execute("ALTER TABLE guilds ALTER COLUMN guild_id TYPE BIGINT USING guild_id::bigint") op.execute("ALTER TABLE guilds ALTER COLUMN owner_id DROP DEFAULT") - op.execute("ALTER TABLE guilds ALTER COLUMN owner_id TYPE BIGINT USING owner_id::bigint") + op.alter_column("guilds", "owner_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="owner_id::bigint") + #op.execute("ALTER TABLE guilds ALTER COLUMN owner_id TYPE BIGINT USING owner_id::bigint") op.drop_column('guilds', 'id') op.execute("ALTER TABLE guilds ADD PRIMARY KEY (guild_id);") op.execute("ALTER TABLE messages ALTER COLUMN channel_id DROP DEFAULT") - op.execute("ALTER TABLE messages ALTER COLUMN channel_id TYPE BIGINT USING channel_id::bigint") + op.alter_column("messages", "channel_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="channel_id::bigint") + #op.execute("ALTER TABLE messages ALTER COLUMN channel_id TYPE BIGINT USING channel_id::bigint") op.execute("ALTER TABLE messages ALTER COLUMN guild_id DROP DEFAULT") - op.execute("ALTER TABLE messages ALTER COLUMN guild_id TYPE BIGINT USING guild_id::bigint") + op.alter_column("messages", "guild_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="guild_id::bigint") + #op.execute("ALTER TABLE messages ALTER COLUMN guild_id TYPE BIGINT USING guild_id::bigint") op.execute("ALTER TABLE messages ALTER COLUMN message_id DROP DEFAULT") - op.execute("ALTER TABLE messages ALTER COLUMN message_id TYPE BIGINT USING message_id::bigint") + op.alter_column("messages", "message_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="message_id::bigint") + #op.execute("ALTER TABLE messages ALTER COLUMN message_id TYPE BIGINT USING message_id::bigint") op.drop_column('messages', 'id') op.execute("ALTER TABLE messages ADD PRIMARY KEY (message_id);") op.execute("ALTER TABLE patreon ALTER COLUMN user_id DROP DEFAULT") - op.execute("ALTER TABLE patreon ALTER COLUMN user_id TYPE BIGINT USING user_id::bigint") + op.alter_column("patreon", "user_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="user_id::bigint") + #op.execute("ALTER TABLE patreon ALTER COLUMN user_id TYPE BIGINT USING user_id::bigint") op.drop_column('patreon', 'id') op.execute("ALTER TABLE patreon ADD PRIMARY KEY (user_id);") op.execute("ALTER TABLE titan_tokens ALTER COLUMN user_id DROP DEFAULT") - op.execute("ALTER TABLE titan_tokens ALTER COLUMN user_id TYPE BIGINT USING user_id::bigint") + op.alter_column("titan_tokens", "user_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="user_id::bigint") + #op.execute("ALTER TABLE titan_tokens ALTER COLUMN user_id TYPE BIGINT USING user_id::bigint") op.drop_column('titan_tokens', 'id') op.execute("ALTER TABLE titan_tokens ADD PRIMARY KEY (user_id);") op.execute("ALTER TABLE token_transactions ALTER COLUMN user_id DROP DEFAULT") - op.execute("ALTER TABLE token_transactions ALTER COLUMN user_id TYPE BIGINT USING user_id::bigint") + op.alter_column("token_transactions", "user_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="user_id::bigint") + #op.execute("ALTER TABLE token_transactions ALTER COLUMN user_id TYPE BIGINT USING user_id::bigint") op.execute("ALTER TABLE unauthenticated_bans ALTER COLUMN guild_id DROP DEFAULT") - op.execute("ALTER TABLE unauthenticated_bans ALTER COLUMN guild_id TYPE BIGINT USING guild_id::bigint") + op.alter_column("unauthenticated_bans", "guild_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="guild_id::bigint") + #op.execute("ALTER TABLE unauthenticated_bans ALTER COLUMN guild_id TYPE BIGINT USING guild_id::bigint") op.execute("ALTER TABLE unauthenticated_bans ALTER COLUMN lifter_id DROP DEFAULT") - op.execute("ALTER TABLE unauthenticated_bans ALTER COLUMN lifter_id TYPE BIGINT USING lifter_id::bigint") + op.alter_column("unauthenticated_bans", "lifter_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="lifter_id::bigint") + #op.execute("ALTER TABLE unauthenticated_bans ALTER COLUMN lifter_id TYPE BIGINT USING lifter_id::bigint") op.execute("ALTER TABLE unauthenticated_bans ALTER COLUMN placer_id DROP DEFAULT") - op.execute("ALTER TABLE unauthenticated_bans ALTER COLUMN placer_id TYPE BIGINT USING placer_id::bigint") + op.alter_column("unauthenticated_bans", "placer_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="placer_id::bigint") + #op.execute("ALTER TABLE unauthenticated_bans ALTER COLUMN placer_id TYPE BIGINT USING placer_id::bigint") op.execute("ALTER TABLE unauthenticated_users ALTER COLUMN guild_id DROP DEFAULT") - op.execute("ALTER TABLE unauthenticated_users ALTER COLUMN guild_id TYPE BIGINT USING guild_id::bigint") + op.alter_column("unauthenticated_bans", "guild_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="guild_id::bigint") + #op.execute("ALTER TABLE unauthenticated_users ALTER COLUMN guild_id TYPE BIGINT USING guild_id::bigint") op.execute("ALTER TABLE user_css ALTER COLUMN user_id DROP DEFAULT") - op.execute("ALTER TABLE user_css ALTER COLUMN user_id TYPE BIGINT USING user_id::bigint") + op.alter_column("user_css", "user_id", existing_type=sa.String(255), type_=sa.BIGINT(), postgresql_using="user_id::bigint") + #op.execute("ALTER TABLE user_css ALTER COLUMN user_id TYPE BIGINT USING user_id::bigint") # ### end Alembic commands ### diff --git a/webapp/alembic/versions/f65629d470c6_add_css_variable_toggle_column.py b/webapp/alembic/versions/f65629d470c6_add_css_variable_toggle_column.py index 7f626c4..502aab0 100644 --- a/webapp/alembic/versions/f65629d470c6_add_css_variable_toggle_column.py +++ b/webapp/alembic/versions/f65629d470c6_add_css_variable_toggle_column.py @@ -50,8 +50,7 @@ def upgrade(): op.alter_column('guilds', 'mentions_limit', existing_type=sa.BIGINT(), type_=sa.Integer(), - existing_nullable=False, - existing_server_default=sa.text('(-1)::bigint')) + existing_nullable=False) op.alter_column('keyvalue_properties', 'expiration', existing_type=postgresql.TIMESTAMP(timezone=True), type_=sa.TIMESTAMP(),