Skip to content

Commit

Permalink
Squash 95 - Remove commented out method
Browse files Browse the repository at this point in the history
  • Loading branch information
MackHalliday committed Jan 2, 2025
1 parent 7d47805 commit c172021
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions app/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,6 @@ def create_year_partition(target: Base, connection: Connection, **kw: any) -> No
event.listen(Notification.__table__, 'after_create', create_year_partition)


# def ensure_future_partition(connection: Connection, date: datetime) -> None:
# """Ensures partition exists for the given date."""
# year = date.year
# partition_name = f'notifications_{year}'

# # Check if partition exists
# exists = connection.execute(f"""
# SELECT EXISTS (
# SELECT 1
# FROM pg_class c
# JOIN pg_namespace n ON n.oid = c.relnamespace
# WHERE c.relname = '{partition_name}'
# );
# """).scalar()

# if not exists:
# connection.execute(f"""
# CREATE TABLE IF NOT EXISTS {partition_name}
# PARTITION OF notifications
# FOR VALUES FROM ('{year}-01-01 00:00:00')
# TO ('{year+1}-01-01 00:00:00');

# CREATE INDEX IF NOT EXISTS idx_{partition_name}_created_at
# ON {partition_name} (created_at);
# """)


class Service(Base):
"""Database table for VA services (business groups)."""

Expand Down

0 comments on commit c172021

Please sign in to comment.