This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


The following commit(s) were added to refs/heads/main by this push:
     new 280fa5a  Exclude Litestream tables from Alembic
280fa5a is described below

commit 280fa5a3b5be30637107e67eba67ce5435fee663
Author: Sean B. Palmer <[email protected]>
AuthorDate: Tue Jan 27 20:38:50 2026 +0000

    Exclude Litestream tables from Alembic
---
 migrations/env.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/migrations/env.py b/migrations/env.py
index 1243ee4..07e82cb 100644
--- a/migrations/env.py
+++ b/migrations/env.py
@@ -64,6 +64,19 @@ def get_short_commit_hash(project_root_path: str) -> str:
         return "00000000"
 
 
+def include_object(
+    object: object,
+    name: str | None,
+    type_: str,
+    reflected: bool,
+    compare_to: object | None,
+) -> bool:
+    """Exclude Litestream internal tables from autogenerate and check."""
+    if (type_ == "table") and name in {"_litestream_seq", "_litestream_lock"}:
+        return False
+    return True
+
+
 def process_revision_directives_custom_naming(
     context: migration.MigrationContext,
     revision: str | Iterable[str | None] | Iterable[str],
@@ -127,6 +140,7 @@ def run_migrations_offline() -> None:
         render_item=render_item_override,
         process_revision_directives=process_revision_directives_custom_naming,
         render_as_batch=True,
+        include_object=include_object,
     )
 
     with alembic.context.begin_transaction():
@@ -151,6 +165,7 @@ def run_migrations_online() -> None:
             render_item=render_item_override,
             
process_revision_directives=process_revision_directives_custom_naming,
             render_as_batch=True,
+            include_object=include_object,
         )
 
         with alembic.context.begin_transaction():


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to