🗃️ Add basic database support using SQLAlchemy and Alembic
This commit is contained in:
parent
d6792c91a8
commit
9a2a18172c
13 changed files with 325 additions and 13 deletions
37
alembic/versions/12669d9a145b_initial_migration.py
Normal file
37
alembic/versions/12669d9a145b_initial_migration.py
Normal file
|
@ -0,0 +1,37 @@
|
|||
"""Initial migration
|
||||
|
||||
Revision ID: 12669d9a145b
|
||||
Revises:
|
||||
Create Date: 2024-06-16 20:53:32.463819
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '12669d9a145b'
|
||||
down_revision: Union[str, None] = None
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('user',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('username', sa.String(), nullable=True),
|
||||
sa.Column('location', sa.String(), nullable=True),
|
||||
sa.Column('room_id', sa.String(), nullable=True),
|
||||
sa.Column('reminder_time_in_minutes', sa.Integer(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('user')
|
||||
# ### end Alembic commands ###
|
Loading…
Add table
Add a link
Reference in a new issue