updated to handle sqlite

This commit is contained in:
smilerz
2021-04-11 17:01:18 -05:00
parent a20ff46d40
commit f87c963e28
5 changed files with 19 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
# Generated by Django 3.1.7 on 2021-04-07 20:00
from django.conf import settings
from django.contrib.postgres.indexes import GinIndex
from django.contrib.postgres.search import SearchVectorField, SearchVector
from django.db import migrations
@@ -8,6 +8,8 @@ from cookbook.models import Recipe
def set_default_search_vector(apps, schema_editor):
if settings.DATABASES['default']['ENGINE'] not in ['django.db.backends.postgresql_psycopg2', 'django.db.backends.postgresql']:
return
with scopes_disabled():
search_vector = (
SearchVector('name', weight='A')
@@ -16,11 +18,9 @@ def set_default_search_vector(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0118_auto_20210406_1805'),
]
operations = [
migrations.AddField(
model_name='recipe',