guild-journal/guild/migrations/0001_initial.py

129 lines
3.9 KiB
Python

# Generated by Django 4.2.1 on 2023-05-19 12:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Adventure",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=255)),
("description", models.TextField()),
],
options={
"verbose_name": "Adventure",
"verbose_name_plural": "Adventures",
},
),
migrations.CreateModel(
name="Character",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=255)),
("description", models.TextField()),
],
options={
"verbose_name": "character",
"verbose_name_plural": "characters",
},
),
migrations.CreateModel(
name="Player",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=255)),
],
options={
"verbose_name": "player",
"verbose_name_plural": "players",
},
),
migrations.CreateModel(
name="PlaySession",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("date", models.DateField()),
("summary", models.TextField()),
(
"adventure",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="guild.adventure",
verbose_name="adventure",
),
),
(
"characters",
models.ManyToManyField(
to="guild.character", verbose_name="characters"
),
),
],
options={
"verbose_name": "playsession",
"verbose_name_plural": "playsessions",
},
),
migrations.AddField(
model_name="character",
name="player",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="guild.player",
verbose_name="player",
),
),
migrations.AddField(
model_name="adventure",
name="master",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="guild.player",
verbose_name="master",
),
),
]