-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commits migration for 2 new core search filters, re #10804
- Loading branch information
1 parent
cba2d87
commit cd11e0f
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# -*- coding: utf-8 -*- | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("models", "10709_refresh_geos_by_transaction"), | ||
] | ||
|
||
sql = """ | ||
update search_component where sortorder = 0 set sortorder = 1; | ||
insert into search_component ( | ||
searchcomponentid, | ||
name, | ||
icon, | ||
modulename, | ||
classname, | ||
type, | ||
componentpath, | ||
componentname, | ||
sortorder, | ||
enabled | ||
) values ( | ||
'69695d63-6f03-4536-8da9-841b07116381', | ||
'Core Search', | ||
'', | ||
'core_search.py.py', | ||
'CoreSearchFilter', | ||
'', | ||
'', | ||
'core-search', | ||
0, | ||
true | ||
), | ||
( | ||
'ada062d9-092d-400c-bcf7-94a931d1f271', | ||
'Localize Result Descriptors', | ||
'', | ||
'localize_result_descriptors.py', | ||
'LocalizeResultDescriptors', | ||
'', | ||
'', | ||
'localize-descriptors', | ||
99, | ||
true | ||
); | ||
""" | ||
reverse_sql = """ | ||
delete from search_component where searchcomponentid in ( | ||
'69695d63-6f03-4536-8da9-841b07116381', | ||
'ada062d9-092d-400c-bcf7-94a931d1f271' | ||
); | ||
""" | ||
|
||
operations = [ | ||
migrations.RunSQL( | ||
sql, | ||
reverse_sql, | ||
) | ||
] |