|
|
|
|
@ -1,19 +1,21 @@
|
|
|
|
|
# Generated by Django 4.1.7 on 2023-03-02 07:14
|
|
|
|
|
|
|
|
|
|
# 说明:此文件由Django 4.1.7版本自动生成,生成时间为2023年3月2日7:14
|
|
|
|
|
# 迁移文件用于记录数据库模型的创建和修改,通过Django的migrate命令同步到数据库
|
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
|
|
|
|
# 导入Django迁移模块和模型字段模块
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
|
|
initial = True
|
|
|
|
|
# 定义迁移类,所有迁移操作都在这个类中定义
|
|
|
|
|
initial = True # 标记为初始迁移(第一次创建模型时生成)
|
|
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
|
]
|
|
|
|
|
] # 依赖的其他迁移文件列表,初始迁移无依赖,所以为空
|
|
|
|
|
# 若后续迁移依赖其他应用的迁移,会在此处列出,如:['appname.0001_initial']
|
|
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
|
migrations.CreateModel(
|
|
|
|
|
operations = [ # 迁移操作列表,包含模型的创建、修改等操作
|
|
|
|
|
migrations.CreateModel( # 创建名为"commands"的模型(对应数据库表)
|
|
|
|
|
name='commands',
|
|
|
|
|
fields=[
|
|
|
|
|
fields=[ # 定义模型的字段(对应数据库表的列)
|
|
|
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
|
('title', models.CharField(max_length=300, verbose_name='命令标题')),
|
|
|
|
|
('command', models.CharField(max_length=2000, verbose_name='命令')),
|
|
|
|
|
@ -21,12 +23,12 @@ class Migration(migrations.Migration):
|
|
|
|
|
('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
|
|
|
|
|
('last_mod_time', models.DateTimeField(auto_now=True, verbose_name='修改时间')),
|
|
|
|
|
],
|
|
|
|
|
options={
|
|
|
|
|
'verbose_name': '命令',
|
|
|
|
|
'verbose_name_plural': '命令',
|
|
|
|
|
},
|
|
|
|
|
options={ # 模型的额外配置
|
|
|
|
|
'verbose_name': '命令', # 模型单数显示名称(后台管理用)
|
|
|
|
|
'verbose_name_plural': '命令', # 模型复数显示名称(后台管理用)
|
|
|
|
|
}, # 若未指定ordering,默认按主键id排序
|
|
|
|
|
),
|
|
|
|
|
migrations.CreateModel(
|
|
|
|
|
migrations.CreateModel( # 创建名为"EmailSendLog"的模型(邮件发送日志)
|
|
|
|
|
name='EmailSendLog',
|
|
|
|
|
fields=[
|
|
|
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
|
@ -39,7 +41,7 @@ class Migration(migrations.Migration):
|
|
|
|
|
options={
|
|
|
|
|
'verbose_name': '邮件发送log',
|
|
|
|
|
'verbose_name_plural': '邮件发送log',
|
|
|
|
|
'ordering': ['-created_time'],
|
|
|
|
|
'ordering': ['-created_time'], # 按创建时间倒序排列(最新的日志在前)
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
]
|
|
|
|
|
|