0001_initial.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # Generated by Django 3.2.5 on 2021-10-04 05:49
  2. from django.conf import settings
  3. from django.db import migrations, models
  4. import django.db.models.deletion
  5. class Migration(migrations.Migration):
  6. initial = True
  7. dependencies = [
  8. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  9. ]
  10. operations = [
  11. migrations.CreateModel(
  12. name='ArticleClass',
  13. fields=[
  14. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  15. ('Name', models.CharField(max_length=50)),
  16. ],
  17. ),
  18. migrations.CreateModel(
  19. name='Tag',
  20. fields=[
  21. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  22. ('Name', models.CharField(max_length=50)),
  23. ],
  24. ),
  25. migrations.CreateModel(
  26. name='Article',
  27. fields=[
  28. ('ArticleId', models.AutoField(primary_key=True, serialize=False)),
  29. ('Title', models.CharField(max_length=50)),
  30. ('Content', models.TextField()),
  31. ('Read', models.IntegerField()),
  32. ('Like', models.IntegerField()),
  33. ('Publish_Time', models.DateTimeField(auto_now_add=True)),
  34. ('Edit_Time', models.DateTimeField(auto_now=True)),
  35. ('Class', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Article.articleclass')),
  36. ('Publisher', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='Poster', to=settings.AUTH_USER_MODEL)),
  37. ('Tag', models.ManyToManyField(to='Article.Tag')),
  38. ],
  39. ),
  40. ]