mirror of https://github.com/doccano/doccano.git
pythonannotation-tooldatasetsactive-learningtext-annotationdatasetnatural-language-processingdata-labelingmachine-learning
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.4 KiB
49 lines
1.4 KiB
# Generated by Django 3.2.11 on 2022-02-04 05:51
|
|
|
|
from django.db import migrations
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
("projects", "0002_auto_20220204_0201"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunSQL(
|
|
sql="""
|
|
UPDATE
|
|
projects_project
|
|
SET
|
|
polymorphic_ctype_id = (
|
|
SELECT
|
|
t2.id
|
|
from
|
|
django_content_type t1
|
|
INNER JOIN django_content_type t2 ON t1.model = t2.model
|
|
WHERE
|
|
t1.app_label = 'api'
|
|
AND t2.app_label = 'projects'
|
|
AND t1.model LIKE '%project'
|
|
AND t1.id = projects_project.polymorphic_ctype_id
|
|
);
|
|
""",
|
|
reverse_sql="""
|
|
UPDATE
|
|
projects_project
|
|
SET
|
|
polymorphic_ctype_id = (
|
|
SELECT
|
|
t1.id
|
|
from
|
|
django_content_type t1
|
|
INNER JOIN django_content_type t2 ON t1.model = t2.model
|
|
WHERE
|
|
t1.app_label = 'api'
|
|
AND t2.app_label = 'projects'
|
|
AND t1.model LIKE '%project'
|
|
AND t2.id = projects_project.polymorphic_ctype_id
|
|
);
|
|
""",
|
|
)
|
|
]
|