initial
This commit is contained in:
34
migrations/versions/01a0ed14f3eb_add_category_model.py
Normal file
34
migrations/versions/01a0ed14f3eb_add_category_model.py
Normal file
@@ -0,0 +1,34 @@
|
||||
"""Add Category model
|
||||
|
||||
Revision ID: 01a0ed14f3eb
|
||||
Revises: 6347615a68b5
|
||||
Create Date: 2025-12-08 20:13:22.898643
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '01a0ed14f3eb'
|
||||
down_revision = '6347615a68b5'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('categories',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sa.String(length=100), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('name')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('categories')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user