-
Notifications
You must be signed in to change notification settings - Fork 1
Migrations from TM and docs #56
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
base: develop
Are you sure you want to change the base?
Changes from all commits
9bd5f34
e1b7234
32d9734
c84583b
c819df6
0c359f1
94c5f14
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| """empty message | ||
|
|
||
| Revision ID: 05e1ecf9953a | ||
| Revises: 22e7d7e0fa02 | ||
| Create Date: 2018-12-04 19:53:41.477085 | ||
|
|
||
| """ | ||
|
|
||
| import sqlalchemy as sa | ||
| from alembic import op | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = "05e1ecf9953a" | ||
| down_revision = "22e7d7e0fa02" | ||
| branch_labels = None | ||
| depends_on = None | ||
|
|
||
|
|
||
| def upgrade(): | ||
| op.create_table( | ||
| "task_annotations", | ||
| sa.Column("id", sa.Integer(), nullable=False), | ||
| sa.Column("project_id", sa.Integer(), nullable=True), | ||
| sa.Column("task_id", sa.Integer(), nullable=False), | ||
| sa.Column("annotation_type", sa.String(), nullable=False), | ||
| sa.Column("annotation_source", sa.String(), nullable=True), | ||
| sa.Column("updated_timestamp", sa.DateTime(), nullable=False), | ||
| sa.Column("properties", sa.JSON(), nullable=False), | ||
| sa.ForeignKeyConstraint(["project_id"], ["projects.id"]), | ||
| sa.ForeignKeyConstraint( | ||
| ["task_id", "project_id"], | ||
| ["tasks.id", "tasks.project_id"], | ||
| name="fk_task_annotations", | ||
| ), | ||
| sa.PrimaryKeyConstraint("id"), | ||
| ) | ||
| op.create_index( | ||
| "idx_task_annotations_composite", | ||
| "task_annotations", | ||
| ["task_id", "project_id"], | ||
| unique=False, | ||
| ) | ||
| op.create_index( | ||
| op.f("ix_task_annotations_project_id"), | ||
| "task_annotations", | ||
| ["project_id"], | ||
| unique=False, | ||
| ) | ||
|
|
||
|
|
||
| def downgrade(): | ||
| op.drop_index(op.f("ix_task_annotations_project_id"), table_name="task_annotations") | ||
| op.drop_index("idx_task_annotations_composite", table_name="task_annotations") | ||
| op.drop_table("task_annotations") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| """empty message | ||
|
|
||
| Revision ID: 05f1b650ddbc | ||
| Revises: 3b8b0956b217 | ||
| Create Date: 2022-08-17 15:58:37.118728 | ||
|
|
||
| """ | ||
|
|
||
| import sqlalchemy as sa | ||
| from alembic import op | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = "05f1b650ddbc" | ||
| down_revision = "3b8b0956b217" | ||
| branch_labels = None | ||
| depends_on = None | ||
|
|
||
|
|
||
| def upgrade(): | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| op.create_table( | ||
| "banner", | ||
| sa.Column("id", sa.Integer(), nullable=False), | ||
| sa.Column("message", sa.String(), nullable=False), | ||
| sa.Column("visible", sa.Boolean(), nullable=False), | ||
| sa.PrimaryKeyConstraint("id"), | ||
| ) | ||
| # ### end Alembic commands ### | ||
|
|
||
|
|
||
| def downgrade(): | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| op.drop_table("banner") | ||
| # ### end Alembic commands ### |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| """empty message | ||
|
|
||
| Revision ID: 068674f06b0f | ||
| Revises: 0eee8c1abd3a | ||
| Create Date: 2019-10-02 08:45:00.553060 | ||
|
|
||
| """ | ||
|
|
||
| import sqlalchemy as sa | ||
| from alembic import op | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = "068674f06b0f" | ||
| down_revision = "0eee8c1abd3a" | ||
| branch_labels = None | ||
| depends_on = None | ||
|
|
||
|
|
||
| def upgrade(): | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| op.add_column("users", sa.Column("picture_url", sa.String(), nullable=True)) | ||
| op.alter_column( | ||
| "users", | ||
| "expert_mode", | ||
| existing_type=sa.BOOLEAN(), | ||
| nullable=True, | ||
| existing_server_default=sa.text("false"), | ||
| ) | ||
| # ### end Alembic commands ### | ||
|
|
||
|
|
||
| def downgrade(): | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| op.alter_column( | ||
| "users", | ||
| "expert_mode", | ||
| existing_type=sa.BOOLEAN(), | ||
| nullable=False, | ||
| existing_server_default=sa.text("false"), | ||
| ) | ||
| op.drop_column("users", "picture_url") | ||
| # ### end Alembic commands ### |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,50 @@ | ||||||
| """create workspaces_imagery table and drop imageryList column from workspaces | ||||||
|
|
||||||
| Revision ID: 073a96d114ab | ||||||
| Revises: 279f8d753529 | ||||||
| Create Date: 2025-09-09 07:58:35.746897 | ||||||
|
|
||||||
| """ | ||||||
|
|
||||||
| import sqlalchemy as sa | ||||||
| from alembic import op | ||||||
|
|
||||||
| # revision identifiers, used by Alembic. | ||||||
| revision = "073a96d114ab" | ||||||
| down_revision = "279f8d753529" | ||||||
| branch_labels = None | ||||||
| depends_on = None | ||||||
|
|
||||||
|
|
||||||
| def upgrade(): | ||||||
| # ### commands auto generated by Alembic - please adjust! ### | ||||||
| op.create_table( | ||||||
| "workspaces_imagery", | ||||||
| sa.Column("workspace_id", sa.Integer(), nullable=False), | ||||||
| sa.Column("definition", sa.Unicode(), nullable=False), | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🔴 Critical | ⚡ Quick win Column type mismatch: The upstream model 🔧 Proposed fix- sa.Column("definition", sa.Unicode(), nullable=False),
+ sa.Column("definition", sa.JSON(), nullable=False),📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| sa.Column("modifiedAt", sa.DateTime(), nullable=False), | ||||||
| sa.Column("modifiedBy", sa.UUID(), nullable=False), | ||||||
| sa.Column("modifiedByName", sa.Unicode(), nullable=False), | ||||||
| sa.ForeignKeyConstraint( | ||||||
| ["workspace_id"], | ||||||
| ["workspaces.id"], | ||||||
| ), | ||||||
| sa.PrimaryKeyConstraint("workspace_id"), | ||||||
| ) | ||||||
|
|
||||||
| with op.batch_alter_table("workspaces", schema=None) as batch_op: | ||||||
| batch_op.drop_column("imageryList") | ||||||
|
|
||||||
| # ### end Alembic commands ### | ||||||
|
|
||||||
|
|
||||||
| def downgrade(): | ||||||
| # ### commands auto generated by Alembic - please adjust! ### | ||||||
|
|
||||||
| with op.batch_alter_table("workspaces", schema=None) as batch_op: | ||||||
| batch_op.add_column( | ||||||
| sa.Column("imageryList", sa.VARCHAR(), autoincrement=False, nullable=True) | ||||||
| ) | ||||||
|
|
||||||
| op.drop_table("workspaces_imagery") | ||||||
| # ### end Alembic commands ### | ||||||
Uh oh!
There was an error while loading. Please reload this page.