Sith/galaxy/migrations/0001_initial.py
2023-04-22 15:32:31 +02:00

113 lines
3.6 KiB
Python

# Generated by Django 3.2.16 on 2023-03-02 10:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name="Galaxy",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("state", models.JSONField(verbose_name="current state")),
],
),
migrations.CreateModel(
name="GalaxyStar",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"mass",
models.PositiveIntegerField(default=0, verbose_name="star mass"),
),
(
"owner",
models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
related_name="galaxy_user",
to=settings.AUTH_USER_MODEL,
verbose_name="star owner",
),
),
],
),
migrations.CreateModel(
name="GalaxyLane",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"distance",
models.PositiveIntegerField(
default=0,
help_text="Distance separating star1 and star2",
verbose_name="distance",
),
),
(
"family",
models.PositiveIntegerField(default=0, verbose_name="family score"),
),
(
"pictures",
models.PositiveIntegerField(
default=0, verbose_name="pictures score"
),
),
(
"clubs",
models.PositiveIntegerField(default=0, verbose_name="clubs score"),
),
(
"star1",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="lanes1",
to="galaxy.galaxystar",
verbose_name="galaxy star 1",
),
),
(
"star2",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="lanes2",
to="galaxy.galaxystar",
verbose_name="galaxy star 2",
),
),
],
),
]