File: //home/arjun/projects/buyercall/buyercall/migrations/versions/6d0b558ebaf5_contact_tag.py
"""add contact tags table
Revision ID: 6d0b558ebaf5
Revises: 49a0a4f7dc40
Create Date: 2022-06-07 12:34:41.849838
"""
# revision identifiers, used by Alembic.
from buyercall.lib.util_sqlalchemy import AwareDateTime
from sqlalchemy.dialects import postgresql
import sqlalchemy as sa
from alembic import op
revision = '6d0b558ebaf5'
down_revision = '49a0a4f7dc40'
branch_labels = None
depends_on = None
def upgrade():
op.create_table('contact_tag',
sa.Column('created_on', AwareDateTime(), nullable=False),
sa.Column('updated_on', AwareDateTime(), nullable=False),
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('sid', postgresql.UUID(as_uuid=True), nullable=True),
sa.Column('name', sa.String(length=128), nullable=False),
sa.Column('is_active', sa.Boolean(), server_default='1', nullable=False),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_contact_tag_sid'), 'contact_tag', ['sid'], unique=True)
def downgrade():
op.drop_index(op.f('ix_contact_tag_sid'), table_name='contact_tag')
op.drop_table('contact_tag')