mirror of
https://github.com/Kludex/awesome-fastapi-projects.git
synced 2025-01-18 23:37:02 +00:00
64 lines
2.0 KiB
Python
64 lines
2.0 KiB
Python
"""First commit
|
|
|
|
Revision ID: a48ca845cfe5
|
|
Revises:
|
|
Create Date: 2021-11-17 09:32:18.940645
|
|
|
|
"""
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "a48ca845cfe5"
|
|
down_revision = None
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table(
|
|
"package",
|
|
sa.Column("created_at", sa.DateTime(), nullable=True),
|
|
sa.Column("updated_at", sa.DateTime(), nullable=True),
|
|
sa.Column("id", sa.Integer(), nullable=False),
|
|
sa.Column("name", sa.String(), nullable=False),
|
|
sa.PrimaryKeyConstraint("id"),
|
|
)
|
|
op.create_table(
|
|
"repository",
|
|
sa.Column("created_at", sa.DateTime(), nullable=True),
|
|
sa.Column("updated_at", sa.DateTime(), nullable=True),
|
|
sa.Column("id", sa.Integer(), nullable=False),
|
|
sa.Column("full_name", sa.String(), nullable=False),
|
|
sa.Column("html_url", sa.String(), nullable=False),
|
|
sa.Column("clone_url", sa.String(), nullable=False),
|
|
sa.Column("stargazers", sa.Integer(), nullable=False),
|
|
sa.PrimaryKeyConstraint("id"),
|
|
)
|
|
op.create_table(
|
|
"dependency",
|
|
sa.Column("created_at", sa.DateTime(), nullable=True),
|
|
sa.Column("updated_at", sa.DateTime(), nullable=True),
|
|
sa.Column("repository_id", sa.Integer(), nullable=False),
|
|
sa.Column("package_id", sa.Integer(), nullable=False),
|
|
sa.ForeignKeyConstraint(
|
|
["package_id"],
|
|
["package.id"],
|
|
),
|
|
sa.ForeignKeyConstraint(
|
|
["repository_id"],
|
|
["repository.id"],
|
|
),
|
|
sa.PrimaryKeyConstraint("repository_id", "package_id"),
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_table("dependency")
|
|
op.drop_table("repository")
|
|
op.drop_table("package")
|
|
# ### end Alembic commands ###
|