rm migration_owners.py

This commit is contained in:
Cayo Puigdefabregas 2020-11-04 20:23:12 +01:00
parent dac0d1d32f
commit 81da7cb9a8
1 changed files with 0 additions and 13 deletions

View File

@ -1,13 +0,0 @@
from ereuse_devicehub.db import db
from ereuse_devicehub.resources.device import models as m
[x.owner_id for x in m.Device.query.filter((m.Computer.id == m.Device.id)).all()]
def migrate(app):
with app.app_context():
for c in m.Component.query.filter():
if c.parent_id:
c.owner_id = c.parent.owner.id
db.session.add(c)
db.session.commit()
db.session.flush()