Add migration for List

This commit is contained in:
Backend IM Bot 2025-03-29 12:50:20 -05:00
parent b711bd3792
commit a9cbd6f67d

View File

@ -0,0 +1,32 @@
"""create lists table
Revision ID: 2f3c1d4e6a7b
Revises: 0001
Create Date: 2023-05-26 15:37:28.753290
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import UUID
import uuid
# revision identifiers, used by Alembic.
revision = '2f3c1d4e6a7b'
down_revision = '0001'
branch_labels = None
depends_on = None
def upgrade():
op.create_table(
'lists',
sa.Column('id', UUID(as_uuid=True), primary_key=True, default=uuid.uuid4),
sa.Column('name', sa.String, nullable=False),
sa.Column('description', sa.String),
sa.Column('created_at', sa.DateTime, server_default=sa.func.now()),
sa.Column('updated_at', sa.DateTime, server_default=sa.func.now(), onupdate=sa.func.now())
)
def downgrade():
op.drop_table('lists')