mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Add birthday commands
This commit is contained in:
parent
016d87bcea
commit
f49f32d2e9
7 changed files with 141 additions and 1 deletions
38
alembic/versions/1716bfecf684_add_birthdays.py
Normal file
38
alembic/versions/1716bfecf684_add_birthdays.py
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
"""Add birthdays
|
||||
|
||||
Revision ID: 1716bfecf684
|
||||
Revises: 581ae6511b98
|
||||
Create Date: 2022-07-19 21:46:42.796349
|
||||
|
||||
"""
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "1716bfecf684"
|
||||
down_revision = "581ae6511b98"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
"birthdays",
|
||||
sa.Column("birthday_id", sa.Integer(), nullable=False),
|
||||
sa.Column("user_id", sa.BigInteger(), nullable=True),
|
||||
sa.Column("birthday", sa.DateTime(), nullable=False),
|
||||
sa.ForeignKeyConstraint(
|
||||
["user_id"],
|
||||
["users.user_id"],
|
||||
),
|
||||
sa.PrimaryKeyConstraint("birthday_id"),
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table("birthdays")
|
||||
# ### end Alembic commands ###
|
||||
Loading…
Add table
Add a link
Reference in a new issue