Commit d15558f8 authored by sim's avatar sim

Fix legacy data: projects must be child of a user node

parent 5e98da94
"""Fix legacy data: projects must be child of a user node
Revision ID: 4e5952eb6d61
Revises: d77f0a598ad0
Create Date: 2018-01-24 15:40:29.318179
"""
from alembic import op
import sqlalchemy as sa
import gargantext
# revision identifiers, used by Alembic.
revision = '4e5952eb6d61'
down_revision = 'd77f0a598ad0'
branch_labels = None
depends_on = None
def upgrade():
op.execute("""UPDATE nodes p SET parent_id = u.id FROM nodes u
WHERE u.typename=1 AND p.typename=2 AND p.parent_id IS NULL AND
u.user_id=p.user_id""")
def downgrade():
pass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment