Add migration for List
This commit is contained in:
parent
b711bd3792
commit
a9cbd6f67d
32
alembic/versions/20250329_125007_84a03fa6_create_list.py
Normal file
32
alembic/versions/20250329_125007_84a03fa6_create_list.py
Normal 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')
|
Loading…
x
Reference in New Issue
Block a user