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
This commit is contained in:
1 parent
5a4e9d6c3d
commit
bc7dd92ed4
1 file changed
+1
-3
+1
-3
@@ -239,6 +239,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'),
|
||||
@@ -359,9 +360,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