kopia lustrzana https://github.com/bugout-dev/moonstream
45 wiersze
1.2 KiB
Python
45 wiersze
1.2 KiB
Python
"""Fix unique constract on registered_contracts to include moonstream_user_id
|
|
|
|
Revision ID: dedd8a7d0624
|
|
Revises: d1be5f227664
|
|
Create Date: 2023-05-02 15:52:36.654980
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "dedd8a7d0624"
|
|
down_revision = "d1be5f227664"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_constraint(
|
|
"uq_registered_contracts_blockchain", "registered_contracts", type_="unique"
|
|
)
|
|
op.create_unique_constraint(
|
|
op.f("uq_registered_contracts_blockchain"),
|
|
"registered_contracts",
|
|
["blockchain", "moonstream_user_id", "address", "contract_type"],
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_constraint(
|
|
op.f("uq_registered_contracts_blockchain"),
|
|
"registered_contracts",
|
|
type_="unique",
|
|
)
|
|
op.create_unique_constraint(
|
|
"uq_registered_contracts_blockchain",
|
|
"registered_contracts",
|
|
["blockchain", "address", "contract_type"],
|
|
)
|
|
# ### end Alembic commands ###
|