mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-11-30 13:20:40 +03:00
add json filed example
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
"""add json chaos
|
||||
|
||||
Revision ID: d021bd4763a5
|
||||
Revises: 0c69050b5a3e
|
||||
Create Date: 2025-07-29 15:21:19.415583
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'd021bd4763a5'
|
||||
down_revision = '0c69050b5a3e'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('random_stuff',
|
||||
sa.Column('id', sa.UUID(), nullable=False),
|
||||
sa.Column('chaos', postgresql.JSON(astext_type=sa.Text()), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
schema='happy_hog'
|
||||
)
|
||||
op.create_unique_constraint(None, 'nonsense', ['name'], schema='happy_hog')
|
||||
op.create_unique_constraint(None, 'stuff', ['name'], schema='happy_hog')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint(None, 'stuff', schema='happy_hog', type_='unique')
|
||||
op.drop_constraint(None, 'nonsense', schema='happy_hog', type_='unique')
|
||||
op.drop_table('random_stuff', schema='happy_hog')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user