forked from polka_billy/porridger
Alembic installed and activated. Poems table added
This commit is contained in:
28
migrations/versions/0006eca30e2c_first.py
Normal file
28
migrations/versions/0006eca30e2c_first.py
Normal file
@ -0,0 +1,28 @@
|
||||
"""first
|
||||
|
||||
Revision ID: 0006eca30e2c
|
||||
Revises:
|
||||
Create Date: 2023-07-23 22:32:43.496939
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0006eca30e2c'
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
pass
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
pass
|
||||
# ### end Alembic commands ###
|
34
migrations/versions/18001c2231e3_poems_table_added.py
Normal file
34
migrations/versions/18001c2231e3_poems_table_added.py
Normal file
@ -0,0 +1,34 @@
|
||||
"""Poems table added
|
||||
|
||||
Revision ID: 18001c2231e3
|
||||
Revises: 33c5716276b5
|
||||
Create Date: 2023-07-23 22:50:16.055961
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '18001c2231e3'
|
||||
down_revision = '33c5716276b5'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('poems',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('poem_text', sa.String(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_poems_id'), 'poems', ['id'], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_poems_id'), table_name='poems')
|
||||
op.drop_table('poems')
|
||||
# ### end Alembic commands ###
|
@ -0,0 +1,70 @@
|
||||
"""Try to make alembic see models
|
||||
|
||||
Revision ID: 33c5716276b5
|
||||
Revises: 0006eca30e2c
|
||||
Create Date: 2023-07-23 22:42:07.532395
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '33c5716276b5'
|
||||
down_revision = '0006eca30e2c'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('announcements',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('user_id', sa.Integer(), nullable=True),
|
||||
sa.Column('name', sa.String(), nullable=True),
|
||||
sa.Column('category', sa.String(), nullable=True),
|
||||
sa.Column('best_by', sa.Integer(), nullable=True),
|
||||
sa.Column('address', sa.String(), nullable=True),
|
||||
sa.Column('longtitude', sa.Integer(), nullable=True),
|
||||
sa.Column('latitude', sa.Integer(), nullable=True),
|
||||
sa.Column('description', sa.String(), nullable=True),
|
||||
sa.Column('src', sa.String(), nullable=True),
|
||||
sa.Column('metro', sa.String(), nullable=True),
|
||||
sa.Column('trashId', sa.Integer(), nullable=True),
|
||||
sa.Column('booked_by', sa.Integer(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_announcements_id'), 'announcements', ['id'], unique=False)
|
||||
op.create_table('trashboxes',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sa.String(), nullable=True),
|
||||
sa.Column('address', sa.String(), nullable=True),
|
||||
sa.Column('latitude', sa.Integer(), nullable=True),
|
||||
sa.Column('longtitude', sa.Integer(), nullable=True),
|
||||
sa.Column('category', sa.String(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_trashboxes_id'), 'trashboxes', ['id'], unique=False)
|
||||
op.create_table('users',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('phone', sa.Integer(), nullable=True),
|
||||
sa.Column('email', sa.String(), nullable=True),
|
||||
sa.Column('password', sa.String(), nullable=True),
|
||||
sa.Column('hashed_password', sa.String(), nullable=True),
|
||||
sa.Column('name', sa.String(), nullable=True),
|
||||
sa.Column('surname', sa.String(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_users_id'), 'users', ['id'], unique=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_users_id'), table_name='users')
|
||||
op.drop_table('users')
|
||||
op.drop_index(op.f('ix_trashboxes_id'), table_name='trashboxes')
|
||||
op.drop_table('trashboxes')
|
||||
op.drop_index(op.f('ix_announcements_id'), table_name='announcements')
|
||||
op.drop_table('announcements')
|
||||
# ### end Alembic commands ###
|
Reference in New Issue
Block a user