Add migration code for the removal of UUID_FUNCTION
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import uuid
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.core.files.storage import FileSystemStorage
|
||||
from django.utils.encoding import force_text
|
||||
|
||||
import mayan.apps.documents.models
|
||||
|
||||
@@ -18,7 +21,7 @@ class Migration(migrations.Migration):
|
||||
model_name='document',
|
||||
name='uuid',
|
||||
field=models.CharField(
|
||||
default=mayan.apps.documents.models.UUID_FUNCTION, max_length=48,
|
||||
default=force_text(uuid.uuid4()), max_length=48,
|
||||
editable=False
|
||||
),
|
||||
preserve_default=True,
|
||||
@@ -27,7 +30,7 @@ class Migration(migrations.Migration):
|
||||
model_name='documentversion',
|
||||
name='file',
|
||||
field=models.FileField(
|
||||
upload_to=mayan.apps.documents.models.UUID_FUNCTION,
|
||||
upload_to=force_text(uuid.uuid4()),
|
||||
storage=FileSystemStorage(),
|
||||
verbose_name='File'
|
||||
),
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.11 on 2018-04-03 07:02
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import uuid
|
||||
|
||||
import django.core.files.storage
|
||||
from django.db import migrations, models
|
||||
from django.utils.encoding import force_text
|
||||
|
||||
import mayan.apps.documents.models
|
||||
|
||||
@@ -18,6 +19,10 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='documentversion',
|
||||
name='file',
|
||||
field=models.FileField(storage=django.core.files.storage.FileSystemStorage(location=b'mayan/media/document_storage'), upload_to=mayan.apps.documents.models.UUID_FUNCTION, verbose_name='File'),
|
||||
field=models.FileField(
|
||||
storage=django.core.files.storage.FileSystemStorage(
|
||||
location=b'mayan/media/document_storage'
|
||||
), upload_to=force_text(uuid.uuid4()), verbose_name='File'
|
||||
),
|
||||
),
|
||||
]
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.11 on 2018-04-29 07:59
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import uuid
|
||||
|
||||
import django.core.files.storage
|
||||
from django.db import migrations, models
|
||||
from django.utils.encoding import force_text
|
||||
|
||||
import mayan.apps.documents.models
|
||||
|
||||
@@ -23,7 +24,11 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='documentversion',
|
||||
name='file',
|
||||
field=models.FileField(storage=django.core.files.storage.FileSystemStorage(location=b'/home/rosarior/development/mayan-edms/mayan/media/document_storage'), upload_to=mayan.apps.documents.models.UUID_FUNCTION, verbose_name='File'),
|
||||
field=models.FileField(
|
||||
storage=django.core.files.storage.FileSystemStorage(
|
||||
location=b'/home/rosarior/development/mayan-edms/mayan/media/document_storage'
|
||||
), upload_to=force_text(uuid.uuid4()), verbose_name='File'
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='documentversion',
|
||||
|
||||
Reference in New Issue
Block a user