We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4c3ff53 + eab595e commit f35d353Copy full SHA for f35d353
backend/src/baserow/core/pgvector.py
@@ -136,6 +136,13 @@ def _create_field_in_model(cls, field: VectorField) -> None:
136
"""
137
138
with connection.schema_editor() as schema_editor:
139
+ # Ensure we only create the field if it does not exist yet. While this
140
+ # should not happen if the SchemaOperation is updated correctly, this can
141
+ # happen in tests or if some manual intervention happened. In any case, if
142
+ # the field already exists, there's no need to fail or log an error.
143
+ schema_editor.sql_create_column = schema_editor.sql_create_column.replace(
144
+ "ADD COLUMN", "ADD COLUMN IF NOT EXISTS"
145
+ )
146
schema_editor.add_field(cls, field)
147
148
SchemaOperation.objects.create(
0 commit comments