Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Backend
Commits
2cf28e16
Commit
2cf28e16
authored
5 years ago
by
Valentin Rigal
Browse files
Options
Downloads
Patches
Plain Diff
Rebase migration
parent
f24fbc9c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
arkindex/documents/migrations/0031_remove_entity_metatype.py
+7
-2
7 additions, 2 deletions
arkindex/documents/migrations/0031_remove_entity_metatype.py
arkindex/documents/migrations/0032_structural_metadata.py
+1
-1
1 addition, 1 deletion
arkindex/documents/migrations/0032_structural_metadata.py
with
8 additions
and
3 deletions
arkindex/documents/migrations/0031_remove_entity_metatype.py
+
7
−
2
View file @
2cf28e16
# Generated by Django 2.2 on 2019-12-13 10:28
from
django.db
import
migrations
from
arkindex_common.enums
import
EntityType
from
arkindex_common.enums
import
EntityType
,
MetaType
from
enum
import
Enum
...
...
@@ -25,6 +24,9 @@ def remove_entity_metatype(apps, schema_editor):
MetaData
.
objects
.
filter
(
type
=
OldMetaType
.
Entity
,
entity__type
=
EntityType
.
Date
).
update
(
type
=
OldMetaType
.
Date
)
MetaData
.
objects
.
filter
(
type
=
OldMetaType
.
Entity
).
update
(
type
=
OldMetaType
.
Text
)
# Restaure MetaType enum
MetaData
.
_meta
.
fields
[
2
].
enum
=
MetaType
def
add_entity_metatype
(
apps
,
schema_editor
):
MetaData
=
apps
.
get_model
(
'
documents
'
,
'
MetaData
'
)
...
...
@@ -38,6 +40,9 @@ def add_entity_metatype(apps, schema_editor):
MetaData
.
_meta
.
fields
[
2
].
enum
=
OldMetaType
MetaData
.
objects
.
exclude
(
entity__isnull
=
True
).
update
(
type
=
OldMetaType
.
Entity
)
# Restaure MetaType enum
MetaData
.
_meta
.
fields
[
2
].
enum
=
MetaType
class
Migration
(
migrations
.
Migration
):
...
...
This diff is collapsed.
Click to expand it.
arkindex/documents/migrations/003
0
_structural_metadata.py
→
arkindex/documents/migrations/003
2
_structural_metadata.py
+
1
−
1
View file @
2cf28e16
...
...
@@ -38,7 +38,7 @@ def reverse_migration(apps, schema_editor):
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
documents
'
,
'
00
29_allowedmetadata
'
),
(
'
documents
'
,
'
00
31_remove_entity_metatype
'
),
]
operations
=
[
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment