Skip to content

Commit

Permalink
task/WG-377: drop deprecated ObservableDataProject table (#232)
Browse files Browse the repository at this point in the history
* 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
nathanfranklin authored Dec 11, 2024
1 parent 4f0b165 commit 302a04e
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 60 deletions.
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 ###
1 change: 0 additions & 1 deletion geoapi/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from .auth import Auth
from .overlay import Overlay
from .tile_server import TileServer
from .observable_data import ObservableDataProject
from .notification import Notification, ProgressNotification
from .imported_file import ImportedFile
from .streetview import (
Expand Down
18 changes: 0 additions & 18 deletions geoapi/models/observable_data.py

This file was deleted.

41 changes: 0 additions & 41 deletions geoapi/tools/check_observable_projects.py

This file was deleted.

0 comments on commit 302a04e

Please sign in to comment.