From 5d078708752b74e3cb743f77ce85b658acb327b5 Mon Sep 17 00:00:00 2001 From: Jona Date: Sat, 18 Nov 2023 10:30:01 -0500 Subject: [PATCH] tests --- .../c7c033c1cdb5_populate_aoi_chunks_table.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/alembic/versions/c7c033c1cdb5_populate_aoi_chunks_table.py b/alembic/versions/c7c033c1cdb5_populate_aoi_chunks_table.py index d1efface..7d519754 100644 --- a/alembic/versions/c7c033c1cdb5_populate_aoi_chunks_table.py +++ b/alembic/versions/c7c033c1cdb5_populate_aoi_chunks_table.py @@ -18,6 +18,13 @@ def upgrade() -> None: + """ + Upgrade the database schema. + + This function subdivides the geometries in the 'aoi' table into smaller chunks + if they have more than 255 points, and inserts these chunks into the 'aoi_chunks' table. + This is done to manage large geometries more efficiently. + """ bind = op.get_bind() session = orm.Session(bind=bind) with session.begin(): @@ -41,6 +48,12 @@ def upgrade() -> None: def downgrade() -> None: + """ + Downgrade the database schema. + + This function clears the 'aoi_chunks' table by truncating it, effectively + undoing the changes made by the upgrade function. + """ bind = op.get_bind() session = orm.Session(bind=bind) with session.begin():