Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
d15558f8
Commit
d15558f8
authored
Jan 24, 2018
by
sim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix legacy data: projects must be child of a user node
parent
5e98da94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
4e5952eb6d61_quick_fix_projects_must_be_child_of_a_.py
...ns/4e5952eb6d61_quick_fix_projects_must_be_child_of_a_.py
+27
-0
No files found.
alembic/versions/4e5952eb6d61_quick_fix_projects_must_be_child_of_a_.py
0 → 100644
View file @
d15558f8
"""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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment