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.

54 lines
1.9 KiB

# Generated by Django 5.0.6 on 2024-05-28 10:01
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('cname', models.CharField(max_length=30, unique=True, verbose_name='类别名称')),
],
options={
'verbose_name_plural': '类别',
'db_table': 't_category',
},
),
migrations.CreateModel(
name='Tag',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('tname', models.CharField(max_length=30, unique=True, verbose_name='标签名称')),
],
options={
'verbose_name_plural': '标签',
'db_table': 't_tag',
},
),
migrations.CreateModel(
name='Post',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=100, unique=True)),
('desc', models.CharField(max_length=100)),
('content', models.TextField()),
('created', models.DateTimeField(auto_now_add=True)),
('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='post.category')),
('tag', models.ManyToManyField(to='post.tag')),
],
options={
'verbose_name_plural': '帖子',
'db_table': 't_post',
},
),
]