adding post table

This commit is contained in:
2026-03-24 23:03:58 -04:00
parent f9a9e5395c
commit 1ef2512daa
7 changed files with 2910 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
from __future__ import annotations
import logging
import re
import sys
from pathlib import Path
from typing import TYPE_CHECKING, Any, Literal
@@ -81,7 +82,13 @@ def include_name(
"""
if type_ == "schema":
# allows a database with multiple schemas to have separate alembic revisions
return name == target_metadata.schema
if type_ == "table":
# Exclude weekly partition tables (e.g. posts_2024_01) from autogenerate.
# They are created via PARTITION OF in migrations. PG propagates schema changes
# from the parent table to all partitions, so only the parent needs ALTER statements.
return name and re.match(r"^posts_\d{4}_\d{2}$", name)
return True