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.
DjangoBlog/servermanager/migrations/0001_initial.py

48 lines
3.0 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 马莹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 # 马莹:标记为初始迁移(第一次创建模型时生成)
dependencies = [
] # 马莹:依赖的其他迁移文件列表,初始迁移无依赖,所以为空
# 马莹:若后续迁移依赖其他应用的迁移,会在此处列出,如:['appname.0001_initial']
operations = [ # 马莹:迁移操作列表,包含模型的创建、修改等操作
migrations.CreateModel( # 马莹:创建名为"commands"的模型(对应数据库表)
name='commands',
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='命令')),
('describe', models.CharField(max_length=300, verbose_name='命令描述')),
('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': '命令', # 马莹:模型复数显示名称(后台管理用)
}, # 马莹若未指定ordering默认按主键id排序
),
migrations.CreateModel( # 马莹:创建名为"EmailSendLog"的模型(邮件发送日志)
name='EmailSendLog',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('emailto', models.CharField(max_length=300, verbose_name='收件人')),
('title', models.CharField(max_length=2000, verbose_name='邮件标题')),
('content', models.TextField(verbose_name='邮件内容')),
('send_result', models.BooleanField(default=False, verbose_name='结果')),
('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
],
options={
'verbose_name': '邮件发送log',
'verbose_name_plural': '邮件发送log',
'ordering': ['-created_time'], # 马莹:按创建时间倒序排列(最新的日志在前)
},
),
]