-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
task/WG-377: drop deprecated ObservableDataProject table (#232)
* Add migration to update to newer PostGis * Revert "Add migration to update to newer PostGis" This reverts commit 74977c7. * Include models so that autogenerate works in sqlachemy2 * Omit PostGIS-related migrations as those handled by postgis PostGIS manages its own schema * Add migraiton of spatial index of feature's the_geom The default behavior for spatial indexing in GeoAlchemy2. This migration should have been added earlier in projects development * Update README now that we try to omit all PostGIS-related migrations See commit 3a641cb * Fix linting/formatting issues * Remove ObservableDataProject * Remove ObservableDataProject
- Loading branch information
1 parent
4f0b165
commit 302a04e
Showing
4 changed files
with
63 additions
and
60 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
geoapi/migrations/versions/20241211_1753-1040b620b32f_remove_observabledataproject.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,63 @@ | ||
"""remove_ObservableDataProject | ||
Revision ID: 1040b620b32f | ||
Revises: f2d7f797c82a | ||
Create Date: 2024-12-11 17:53:36.850536 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "1040b620b32f" | ||
down_revision = "f2d7f797c82a" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_index( | ||
"ix_observable_data_projects_project_id", table_name="observable_data_projects" | ||
) | ||
op.drop_table("observable_data_projects") | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table( | ||
"observable_data_projects", | ||
sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False), | ||
sa.Column("project_id", sa.INTEGER(), autoincrement=False, nullable=True), | ||
sa.Column( | ||
"created_date", | ||
postgresql.TIMESTAMP(timezone=True), | ||
server_default=sa.text("now()"), | ||
autoincrement=False, | ||
nullable=True, | ||
), | ||
sa.Column("system_id", sa.VARCHAR(), autoincrement=False, nullable=False), | ||
sa.Column("path", sa.VARCHAR(), autoincrement=False, nullable=False), | ||
sa.Column("watch_content", sa.BOOLEAN(), autoincrement=False, nullable=True), | ||
sa.ForeignKeyConstraint( | ||
["project_id"], | ||
["projects.id"], | ||
name="observable_data_projects_project_id_fkey", | ||
onupdate="CASCADE", | ||
ondelete="CASCADE", | ||
), | ||
sa.PrimaryKeyConstraint("id", name="observable_data_projects_pkey"), | ||
sa.UniqueConstraint( | ||
"system_id", "path", name="observable_data_projects_system_id_path_key" | ||
), | ||
) | ||
op.create_index( | ||
"ix_observable_data_projects_project_id", | ||
"observable_data_projects", | ||
["project_id"], | ||
unique=False, | ||
) | ||
# ### 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.