migrations

This commit is contained in:
SvyatoslavArtymovych 2023-04-26 11:42:14 +03:00
parent 2a0a7958cc
commit c309f3243f
2 changed files with 5 additions and 36 deletions

View File

@ -1,32 +0,0 @@
"""book.about
Revision ID: 254acdcfcc97
Revises: 02f6f2ebad1b
Create Date: 2023-04-24 12:45:18.363151
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '254acdcfcc97'
down_revision = '02f6f2ebad1b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('books', schema=None) as batch_op:
batch_op.add_column(sa.Column('about', sa.Text(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('books', schema=None) as batch_op:
batch_op.drop_column('about')
# ### end Alembic commands ###

View File

@ -1,8 +1,8 @@
"""empty message """init
Revision ID: 02f6f2ebad1b Revision ID: e96f96cb7d02
Revises: Revises:
Create Date: 2023-04-21 17:26:06.003994 Create Date: 2023-04-26 11:40:49.008918
""" """
from alembic import op from alembic import op
@ -10,7 +10,7 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = '02f6f2ebad1b' revision = 'e96f96cb7d02'
down_revision = None down_revision = None
branch_labels = None branch_labels = None
depends_on = None depends_on = None
@ -37,6 +37,7 @@ def upgrade():
) )
op.create_table('books', op.create_table('books',
sa.Column('label', sa.String(length=1024), nullable=False), sa.Column('label', sa.String(length=1024), nullable=False),
sa.Column('about', sa.Text(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=True), sa.Column('user_id', sa.Integer(), nullable=True),
sa.Column('id', sa.Integer(), nullable=False), sa.Column('id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=True), sa.Column('created_at', sa.DateTime(), nullable=True),