2024-10-16 09:53:16 +00:00
|
|
|
"""Add folder table
|
|
|
|
|
|
|
|
Revision ID: c69f45358db4
|
|
|
|
Revises: 3ab32c4b8f59
|
|
|
|
Create Date: 2024-10-16 02:02:35.241684
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
from alembic import op
|
|
|
|
import sqlalchemy as sa
|
|
|
|
|
|
|
|
revision = "c69f45358db4"
|
|
|
|
down_revision = "3ab32c4b8f59"
|
|
|
|
branch_labels = None
|
|
|
|
depends_on = None
|
|
|
|
|
|
|
|
|
|
|
|
def upgrade():
|
|
|
|
op.create_table(
|
|
|
|
"folder",
|
2024-10-16 10:35:26 +00:00
|
|
|
sa.Column("id", sa.Text(), nullable=False),
|
2024-10-16 09:53:16 +00:00
|
|
|
sa.Column("parent_id", sa.Text(), nullable=True),
|
2024-10-16 10:35:26 +00:00
|
|
|
sa.Column("user_id", sa.Text(), nullable=False),
|
2024-10-16 09:53:16 +00:00
|
|
|
sa.Column("name", sa.Text(), nullable=False),
|
|
|
|
sa.Column("items", sa.JSON(), nullable=True),
|
|
|
|
sa.Column("meta", sa.JSON(), nullable=True),
|
|
|
|
sa.Column(
|
|
|
|
"created_at", sa.DateTime(), server_default=sa.func.now(), nullable=False
|
|
|
|
),
|
|
|
|
sa.Column(
|
|
|
|
"updated_at",
|
|
|
|
sa.DateTime(),
|
|
|
|
nullable=False,
|
|
|
|
server_default=sa.func.now(),
|
|
|
|
onupdate=sa.func.now(),
|
|
|
|
),
|
2024-10-16 10:35:26 +00:00
|
|
|
sa.PrimaryKeyConstraint("id", "user_id")
|
2024-10-16 09:53:16 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
def downgrade():
|
|
|
|
op.drop_table("folder")
|