mirror of
https://github.com/RichieCahill/dotfiles.git
synced 2026-04-17 13:08:19 -04:00
adding post table
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user