mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-11-30 13:20:40 +03:00
reset alembic
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
"""user auth
|
||||
|
||||
Revision ID: 2dcc708f88f8
|
||||
Revises: 0d1ee3949d21
|
||||
Create Date: 2023-07-22 12:19:28.780926
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '2dcc708f88f8'
|
||||
down_revision = '0d1ee3949d21'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('user',
|
||||
sa.Column('id', sa.UUID(), nullable=False),
|
||||
sa.Column('email', sa.String(), nullable=False),
|
||||
sa.Column('first_name', sa.String(), nullable=False),
|
||||
sa.Column('last_name', sa.String(), nullable=False),
|
||||
sa.Column('password', sa.LargeBinary(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('id')
|
||||
)
|
||||
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('user')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,16 +1,16 @@
|
||||
"""init migrations
|
||||
"""
|
||||
|
||||
Revision ID: 0d1ee3949d21
|
||||
Revision ID: 68cd4c3a0af0
|
||||
Revises:
|
||||
Create Date: 2023-03-11 20:08:07.362613
|
||||
Create Date: 2024-01-02 20:12:46.214651
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0d1ee3949d21'
|
||||
revision = '68cd4c3a0af0'
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
@@ -19,18 +19,18 @@ depends_on = None
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('nonsense',
|
||||
sa.Column('id', sa.UUID(), autoincrement=True, nullable=True),
|
||||
sa.Column('id', sa.UUID(), autoincrement=True, nullable=False),
|
||||
sa.Column('name', sa.String(), nullable=False),
|
||||
sa.Column('description', sa.String(), nullable=False),
|
||||
sa.Column('description', sa.String(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('name'),
|
||||
sa.UniqueConstraint('id'),
|
||||
sa.UniqueConstraint('name'),
|
||||
schema='happy_hog'
|
||||
)
|
||||
op.create_table('stuff',
|
||||
sa.Column('id', sa.UUID(), autoincrement=True, nullable=True),
|
||||
sa.Column('id', sa.UUID(), autoincrement=True, nullable=False),
|
||||
sa.Column('name', sa.String(), nullable=False),
|
||||
sa.Column('description', sa.String(), nullable=False),
|
||||
sa.Column('description', sa.String(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('name'),
|
||||
sa.UniqueConstraint('id'),
|
||||
sa.UniqueConstraint('name'),
|
||||
@@ -67,6 +67,25 @@ def upgrade():
|
||||
sa.PrimaryKeyConstraint('id', name='work_pkey'),
|
||||
schema='shakespeare'
|
||||
)
|
||||
op.create_table('user',
|
||||
sa.Column('id', sa.UUID(), nullable=False),
|
||||
sa.Column('email', sa.String(), nullable=False),
|
||||
sa.Column('first_name', sa.String(), nullable=False),
|
||||
sa.Column('last_name', sa.String(), nullable=False),
|
||||
sa.Column('_password', sa.LargeBinary(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('email')
|
||||
)
|
||||
op.create_table('stuff_full_of_nonsense',
|
||||
sa.Column('id', sa.UUID(), nullable=False),
|
||||
sa.Column('stuff_id', sa.UUID(), nullable=False),
|
||||
sa.Column('nonsense_id', sa.UUID(), nullable=False),
|
||||
sa.Column('but_why', sa.String(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['nonsense_id'], ['happy_hog.nonsense.id'], ),
|
||||
sa.ForeignKeyConstraint(['stuff_id'], ['happy_hog.stuff.id'], ),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
schema='happy_hog'
|
||||
)
|
||||
op.create_table('chapter',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('work_id', sa.String(length=32), nullable=False),
|
||||
@@ -113,6 +132,8 @@ def downgrade():
|
||||
op.drop_table('paragraph', schema='shakespeare')
|
||||
op.drop_table('character_work', schema='shakespeare')
|
||||
op.drop_table('chapter', schema='shakespeare')
|
||||
op.drop_table('stuff_full_of_nonsense', schema='happy_hog')
|
||||
op.drop_table('user')
|
||||
op.drop_table('work', schema='shakespeare')
|
||||
op.drop_table('wordform', schema='shakespeare')
|
||||
op.drop_table('character', schema='shakespeare')
|
||||
Reference in New Issue
Block a user