with session
This commit is contained in:
parent
03c24396e0
commit
14ede9d1b1
1 changed files with 23 additions and 20 deletions
|
@ -184,6 +184,7 @@ PRAGMA journal_mode=WAL
|
|||
def upgrade_db(old, new=None):
|
||||
if new:
|
||||
if old <= '20140525-92-eac91e7' and new > '20140525-92-eac91e7':
|
||||
with db.session():
|
||||
import user.models
|
||||
for u in user.models.User.query:
|
||||
u.update_name()
|
||||
|
@ -198,6 +199,7 @@ def upgrade_db(old, new=None):
|
|||
if changed:
|
||||
f.save()
|
||||
if old <= '20140526-118-d451eb3' and new > '20140526-118-d451eb3':
|
||||
with db.session():
|
||||
import item.models
|
||||
item.models.Find.query.filter_by(key='list').delete()
|
||||
|
||||
|
@ -224,7 +226,8 @@ def upgrade_db(old, new=None):
|
|||
]
|
||||
for sql in statements:
|
||||
run_sql(sql.format(oid=settings.OLD_USER_ID, nid=settings.USER_ID))
|
||||
if old <= '20151201-378-75164a8':
|
||||
if old <= '20151201-384-03c2439':
|
||||
with db.session():
|
||||
import item.models
|
||||
for i in item.models.Item.query:
|
||||
for f in i.files.all():
|
||||
|
|
Loading…
Reference in a new issue