Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Squish #289

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 0 additions & 68 deletions migrations/versions/3fcdf6f2886b_add_shapecollections.py

This file was deleted.

This file was deleted.

56 changes: 0 additions & 56 deletions migrations/versions/5cacb139c494_add_manifest_to_model.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
"""init db
"""init

Revision ID: ee47e252795d
Revision ID: 6114d2b80bc6
Revises:
Create Date: 2022-06-17 15:36:46.968440
Create Date: 2023-10-16 20:10:01.622863

"""
import sqlalchemy as sa
from alembic import op

# from sqlalchemy.dialects.postgresql import JSON
from buildingmotif.database.utils import JSONType

# revision identifiers, used by Alembic.
revision = "ee47e252795d"
revision = "6114d2b80bc6"
down_revision = None
branch_labels = None
depends_on = None
Expand All @@ -20,41 +21,57 @@
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"models",
"shape_collection",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("name", sa.String(), nullable=True),
sa.Column("graph_id", sa.String(), nullable=True),
sa.PrimaryKeyConstraint("id"),
)
op.create_table(
"library",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("name", sa.String(), nullable=False),
sa.Column("shape_collection_id", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["shape_collection_id"],
["shape_collection.id"],
),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("name"),
)
op.create_table(
"models",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("name", sa.String(), nullable=True),
sa.Column("description", sa.Text(), nullable=False),
sa.Column("graph_id", sa.String(), nullable=True),
sa.Column("manifest_id", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["manifest_id"],
["shape_collection.id"],
),
sa.PrimaryKeyConstraint("id"),
)
op.create_table(
"template",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("name", sa.String(), nullable=False),
sa.Column("_head", sa.String(), nullable=False),
sa.Column("body_id", sa.String(), nullable=True),
sa.Column("optional_args", JSONType(), nullable=True),
sa.Column("library_id", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["library_id"],
["library.id"],
),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint(
"name",
"library_id",
name="name_library_unique_constraint",
"name", "library_id", name="name_library_unique_constraint"
),
)
op.create_table(
"deps_association_table",
sa.Column("dependant_id", sa.Integer(), nullable=False),
sa.Column("dependee_id", sa.Integer(), nullable=False),
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("dependant_id", sa.Integer(), nullable=True),
sa.Column("dependee_id", sa.Integer(), nullable=True),
sa.Column("args", JSONType(), nullable=True),
sa.ForeignKeyConstraint(
["dependant_id"],
Expand All @@ -64,7 +81,13 @@ def upgrade():
["dependee_id"],
["template.id"],
),
sa.PrimaryKeyConstraint("dependant_id", "dependee_id", name="pk_constraint"),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint(
"dependant_id",
"dependee_id",
"args",
name="deps_association_unique_constraint",
),
)
# ### end Alembic commands ###

Expand All @@ -73,6 +96,7 @@ def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table("deps_association_table")
op.drop_table("template")
op.drop_table("library")
op.drop_table("models")
op.drop_table("library")
op.drop_table("shape_collection")
# ### end Alembic commands ###
37 changes: 0 additions & 37 deletions migrations/versions/66121a0432bc_add_optional_args_to_template.py

This file was deleted.

32 changes: 0 additions & 32 deletions migrations/versions/99fd5e88689c_add_description_to_model.py

This file was deleted.