-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refact!: remove bundles (deprecated part of spec)
- Loading branch information
1 parent
46a3cf5
commit ab3a7b1
Showing
11 changed files
with
115 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
chord_drs/migrations/versions/5e982af5cde4_remove_bundles.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
"""remove bundles | ||
Revision ID: 5e982af5cde4 | ||
Revises: dcd501398d46 | ||
Create Date: 2024-07-17 19:54:03.564099 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "5e982af5cde4" | ||
down_revision = "dcd501398d46" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
|
||
with op.batch_alter_table("drs_object", schema=None) as batch_op: | ||
batch_op.drop_constraint(None, type_="foreignkey") | ||
batch_op.drop_column("bundle_id") | ||
|
||
op.drop_table("drs_bundle") | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
|
||
op.create_table( | ||
"drs_bundle", | ||
sa.Column("id", sa.VARCHAR(), nullable=False), | ||
sa.Column("created", sa.DATETIME(), server_default=sa.text("(CURRENT_TIMESTAMP)"), nullable=True), | ||
sa.Column("checksum", sa.VARCHAR(length=64), nullable=False), | ||
sa.Column("size", sa.INTEGER(), nullable=True), | ||
sa.Column("name", sa.VARCHAR(length=250), nullable=True), | ||
sa.Column("description", sa.VARCHAR(length=1000), nullable=True), | ||
sa.Column("parent_bundle_id", sa.INTEGER(), nullable=True), | ||
sa.Column("project_id", sa.VARCHAR(length=64), nullable=True), | ||
sa.Column("dataset_id", sa.VARCHAR(length=64), nullable=True), | ||
sa.Column("data_type", sa.VARCHAR(length=24), nullable=True), | ||
sa.Column("public", sa.BOOLEAN(), server_default=sa.text("0"), nullable=False), | ||
sa.ForeignKeyConstraint( | ||
["parent_bundle_id"], | ||
["drs_bundle.id"], | ||
), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
|
||
with op.batch_alter_table("drs_object", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("bundle_id", sa.INTEGER(), nullable=True)) | ||
batch_op.create_foreign_key(None, "drs_bundle", ["bundle_id"], ["id"]) | ||
|
||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.