together_backend/migrations/versions/4947792c7572_create_group_c...

41 lines
1.3 KiB
Python

"""create group_chat table
Revision ID: 4947792c7572
Revises: 86195fe53b88
Create Date: 2023-08-22 11:20:25.259711
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '4947792c7572'
down_revision = '86195fe53b88'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('group_chat',
sa.Column('id', sa.String(length=11), nullable=False),
sa.Column('name', sa.String(), nullable=False),
sa.Column('supervisor', sa.String(length=26), nullable=False),
sa.Column('administrators', sa.ARRAY(sa.String(length=26)), nullable=False),
sa.Column('members', sa.ARRAY(sa.String(length=26)), nullable=False),
sa.Column('introduction', sa.String(length=100), nullable=False),
sa.Column('tags', sa.ARRAY(sa.String()), nullable=False),
sa.Column('noticeboard', postgresql.JSONB(astext_type=sa.Text()), nullable=False),
sa.Column('avatar', sa.String(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=False),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('group_chat')
# ### end Alembic commands ###