cic-internal-integration/apps/cic-eth/cic_eth/db/migrations/default/versions/75d4767b3031_lock.py

35 lines
929 B
Python
Raw Normal View History

2021-04-04 14:40:59 +02:00
"""Lock
2021-02-01 18:12:51 +01:00
2021-04-04 14:40:59 +02:00
Revision ID: 75d4767b3031
Revises: 1f1b3b641d08
Create Date: 2021-04-02 18:41:20.864265
2021-02-01 18:12:51 +01:00
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
2021-04-04 14:40:59 +02:00
revision = '75d4767b3031'
down_revision = '1f1b3b641d08'
2021-02-01 18:12:51 +01:00
branch_labels = None
depends_on = None
def upgrade():
op.create_table(
'lock',
sa.Column('id', sa.Integer, primary_key=True),
sa.Column("address", sa.String(42), nullable=True),
sa.Column('blockchain', sa.String),
sa.Column("flags", sa.BIGINT(), nullable=False, default=0),
sa.Column("date_created", sa.DateTime, nullable=False),
2021-04-04 14:40:59 +02:00
sa.Column("otx_id", sa.Integer, sa.ForeignKey('otx.id'), nullable=True),
2021-02-01 18:12:51 +01:00
)
op.create_index('idx_chain_address', 'lock', ['blockchain', 'address'], unique=True)
2021-04-04 14:40:59 +02:00
2021-02-01 18:12:51 +01:00
def downgrade():
op.drop_index('idx_chain_address')
op.drop_table('lock')