Skip to content
Snippets Groups Projects
Commit 10472aec authored by Ivan Procaccini's avatar Ivan Procaccini
Browse files

Chore: Add initial migration script

parent a544853f
No related branches found
No related tags found
No related merge requests found
"""Initial migration
Revision ID: 446754d1f481
Revises:
Create Date: 2022-08-22 13:36:08.712644
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "446754d1f481"
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"authenticated_user",
sa.Column("username", sa.String(length=10), nullable=False),
sa.Column("firstname", sa.String(), nullable=True),
sa.Column("surname", sa.String(), nullable=True),
sa.PrimaryKeyConstraint("username"),
)
op.create_table(
"project",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("proposer", sa.String(), nullable=True),
sa.Column("title", sa.String(), nullable=True),
sa.Column("description", sa.String(), nullable=True),
sa.Column(
"timestamp",
sa.DateTime(),
server_default=sa.text("TIMEZONE('utc', CURRENT_TIMESTAMP)"),
nullable=False,
),
sa.PrimaryKeyConstraint("id"),
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table("project")
op.drop_table("authenticated_user")
# ### end Alembic commands ###
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment