Use select to True on create_date
If the index is created only in __register__ then it is dropped before being created again. issue11197 review389881002 (grafted from b6547efd68b65333187775ad1a01416bee2e3043) --HG-- branch : 6.0
This commit is contained in:
1 parent
21fead0845
commit
50ef749eeb
1 file changed
+1
-3
+1
-3
@@ -243,6 +243,7 @@ class Purchase(
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Purchase, cls).__setup__()
|
||||
cls.create_date.select = True
|
||||
cls._order = [
|
||||
('purchase_date', 'DESC NULLS FIRST'),
|
||||
('id', 'DESC'),
|
||||
@@ -363,9 +364,6 @@ class Purchase(
|
||||
values=['processing'],
|
||||
where=sql_table.id.in_(sub_query.select(sub_query.id))))
|
||||
|
||||
# Add index on create_date
|
||||
table.index_action('create_date', action='add')
|
||||
|
||||
# Migration from 5.6: rename state cancel to cancelled
|
||||
cursor.execute(*sql_table.update(
|
||||
[sql_table.state], ['cancelled'],
|
||||
|
||||
Reference in new issue
Block a user