Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Tables like embedding_vector_index_***_nod are ignored during database migration #11702

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion api/migrations/env.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import re
from logging.config import fileConfig

from alembic import context
Expand Down Expand Up @@ -33,6 +34,7 @@ def get_engine_url():
config.set_main_option('sqlalchemy.url', get_engine_url())
target_db = current_app.extensions['migrate'].db


# other values from the config, defined by the needs of env.py,
# can be acquired:
# my_important_option = config.get_main_option("my_important_option")
Expand All @@ -48,6 +50,8 @@ def get_metadata():
def include_object(object, name, type_, reflected, compare_to):
if type_ == "foreign_key_constraint":
return False
elif type_ == "table" and re.match(r"^embedding_vector_index_.*?_nod$", name):
return False
else:
return True

Expand Down Expand Up @@ -110,4 +114,3 @@ def process_revision_directives(context, revision, directives):
run_migrations_offline()
else:
run_migrations_online()

Loading