mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-10 08:05:22 +02:00
44 lines
1.3 KiB
Python
44 lines
1.3 KiB
Python
"""add user configuration
|
|
|
|
Revision ID: 3a0384c5ab2e
|
|
Revises: 1d441e79db94
|
|
Create Date: 2025-04-24 12:26:33.635090
|
|
|
|
"""
|
|
|
|
from typing import Sequence, Union
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = "3a0384c5ab2e"
|
|
down_revision: Union[str, None] = "1d441e79db94"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table(
|
|
"user_configurations",
|
|
sa.Column("id", sa.Integer(), nullable=False),
|
|
sa.Column("user_id", sa.Integer(), nullable=True),
|
|
sa.Column("configuration", sa.JSON(), nullable=False),
|
|
sa.ForeignKeyConstraint(
|
|
["user_id"],
|
|
["users.id"],
|
|
),
|
|
sa.PrimaryKeyConstraint("id"),
|
|
)
|
|
op.create_index(
|
|
op.f("ix_user_configurations_id"), "user_configurations", ["id"], unique=False
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_index(op.f("ix_user_configurations_id"), table_name="user_configurations")
|
|
op.drop_table("user_configurations")
|
|
# ### end Alembic commands ###
|