MrDoc/app_doc/migrations/0011_auto_20200313_2143.py

53 lines
2.2 KiB
Python

# Generated by Django 2.1 on 2020-03-13 21:43
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('app_doc', '0010_auto_20200310_2032'),
]
operations = [
migrations.CreateModel(
name='Image',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('file_path', models.CharField(max_length=250, verbose_name='图片路径')),
('remark', models.CharField(blank=True, default='图片描述', max_length=250, null=True, verbose_name='图片备注')),
('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
('modify_time', models.DateTimeField(auto_now=True, verbose_name='修改时间')),
],
options={
'verbose_name': '素材图片',
'verbose_name_plural': '素材图片',
},
),
migrations.CreateModel(
name='ImageGroup',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('group_name', models.CharField(default='默认分组', max_length=50, verbose_name='图片分组')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': '图片分组',
'verbose_name_plural': '图片分组',
},
),
migrations.AddField(
model_name='image',
name='group',
field=models.ForeignKey(default=-1, on_delete=django.db.models.deletion.SET_DEFAULT, to='app_doc.ImageGroup', verbose_name='图片分组'),
),
migrations.AddField(
model_name='image',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
]