mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-15 22:39:25 +00:00
galaxy: big refactor
Main changes: - Multiple Galaxy objects can now exist at the same time in DB. This allows for ruling a new galaxy while still displaying the old one. - The criteria to quickly know whether a user is a possible citizen is now a simple query on picture count. This avoids a very complicated query to database, that could often result in huge working memory load. With this change, it should be possible to run the galaxy even on a vanilla Postgres that didn't receive fine tuning for the Sith's galaxy.
This commit is contained in:
45
galaxy/migrations/0002_auto_20230412_1130.py
Normal file
45
galaxy/migrations/0002_auto_20230412_1130.py
Normal file
@ -0,0 +1,45 @@
|
||||
# Generated by Django 3.2.16 on 2023-04-12 09:30
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
("galaxy", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="galaxy",
|
||||
options={"ordering": ["pk"]},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="galaxystar",
|
||||
name="galaxy",
|
||||
field=models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="stars",
|
||||
to="galaxy.galaxy",
|
||||
verbose_name="the galaxy this star belongs to",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="galaxy",
|
||||
name="state",
|
||||
field=models.JSONField(null=True, verbose_name="The galaxy current state"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="galaxystar",
|
||||
name="owner",
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="stars",
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
verbose_name="star owner",
|
||||
),
|
||||
),
|
||||
]
|
Reference in New Issue
Block a user