1
0

[update]: Database schema

This commit is contained in:
VivianDee
2025-03-28 15:49:37 +01:00
parent bc8f8e2cdd
commit 68ad9e35a1
8 changed files with 38 additions and 42 deletions
@@ -1,8 +1,8 @@
"""Create tables
"""Update Offers
Revision ID: 4a12e1b143a4
Revision ID: fd58e10e4968
Revises:
Create Date: 2025-03-28 09:24:49.669509
Create Date: 2025-03-28 15:47:35.620664
"""
from alembic import op
@@ -10,7 +10,7 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4a12e1b143a4'
revision = 'fd58e10e4968'
down_revision = None
branch_labels = None
depends_on = None
@@ -26,8 +26,7 @@ def upgrade():
sa.Column('lien_amount', sa.Float(), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('updated_at', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id'),
schema='flask_app'
sa.PrimaryKeyConstraint('id')
)
op.create_table('customers',
sa.Column('id', sa.String(length=50), nullable=False),
@@ -36,8 +35,7 @@ def upgrade():
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('updated_at', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('msisdn'),
schema='flask_app'
sa.UniqueConstraint('msisdn')
)
op.create_table('loans',
sa.Column('id', sa.String(length=50), nullable=False),
@@ -48,8 +46,7 @@ def upgrade():
sa.Column('status', sa.String(length=20), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('updated_at', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id'),
schema='flask_app'
sa.PrimaryKeyConstraint('id')
)
op.create_table('transactions',
sa.Column('id', sa.String(length=50), nullable=False),
@@ -59,16 +56,20 @@ def upgrade():
sa.Column('status', sa.String(length=20), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('updated_at', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id'),
schema='flask_app'
sa.PrimaryKeyConstraint('id')
)
op.drop_table('test')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('transactions', schema='flask_app')
op.drop_table('loans', schema='flask_app')
op.drop_table('customers', schema='flask_app')
op.drop_table('accounts', schema='flask_app')
op.create_table('test',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('name', sa.VARCHAR(length=125), autoincrement=False, nullable=True)
)
op.drop_table('transactions')
op.drop_table('loans')
op.drop_table('customers')
op.drop_table('accounts')
# ### end Alembic commands ###