feat: permission json to text

This commit is contained in:
junjun
2025-08-05 11:00:18 +08:00
parent 86abe25e27
commit 98bc8a51bb
2 changed files with 2 additions and 45 deletions
@@ -38,8 +38,8 @@ def upgrade():
sa.Column('enable', sa.Boolean(), nullable=False),
sa.Column('name', sqlmodel.sql.sqltypes.AutoString(length=128), nullable=False),
sa.Column('description', sqlmodel.sql.sqltypes.AutoString(length=512), nullable=True),
sa.Column('permission_list', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
sa.Column('user_list', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
sa.Column('permission_list', sa.Text(), nullable=True),
sa.Column('user_list', sa.Text(), nullable=True),
sa.Column('white_list_user', sa.Text(), nullable=True),
sa.Column('create_time', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id')
@@ -1,43 +0,0 @@
"""034_permission_modify
Revision ID: 2ec7855d3564
Revises: 3cb5d6a54f2e
Create Date: 2025-08-04 19:54:41.533467
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '2ec7855d3564'
down_revision = '3cb5d6a54f2e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('ds_rules', 'permission_list',
existing_type=postgresql.JSONB(astext_type=sa.Text()),
type_=sa.Text(),
existing_nullable=True)
op.alter_column('ds_rules', 'user_list',
existing_type=postgresql.JSONB(astext_type=sa.Text()),
type_=sa.Text(),
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('ds_rules', 'user_list',
existing_type=sa.Text(),
type_=postgresql.JSONB(astext_type=sa.Text()),
existing_nullable=True)
op.alter_column('ds_rules', 'permission_list',
existing_type=sa.Text(),
type_=postgresql.JSONB(astext_type=sa.Text()),
existing_nullable=True)
# ### end Alembic commands ###