1
0
Fork 0
spejstore-new/storage/migrations/0001_squashed_0008_item_sta...

149 lines
4.5 KiB
Python
Raw Permalink Normal View History

2016-09-29 20:20:10 +00:00
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-29 22:03
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
from django.contrib.postgres.fields import HStoreField
from django.contrib.postgres.operations import HStoreExtension
from django.contrib.postgres.operations import TrigramExtension
2016-09-29 20:20:10 +00:00
import uuid
class Migration(migrations.Migration):
2023-07-11 13:34:35 +00:00
replaces = [
("storage", "0001_initial"),
("storage", "0002_auto_20160929_2125"),
("storage", "0003_auto_20160929_2134"),
("storage", "0004_auto_20160929_2143"),
("storage", "0005_auto_20160929_2151"),
("storage", "0006_auto_20160929_2153"),
("storage", "0007_auto_20160929_2153"),
("storage", "0008_item_state"),
]
2016-09-29 20:20:10 +00:00
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
HStoreExtension(),
TrigramExtension(),
2016-09-29 20:20:10 +00:00
migrations.CreateModel(
2023-07-11 13:34:35 +00:00
name="Item",
2016-09-29 20:20:10 +00:00
fields=[
2023-07-11 13:34:35 +00:00
("name", models.TextField()),
("description", models.TextField(blank=True)),
("props", HStoreField()),
2023-07-11 13:34:35 +00:00
(
"uuid",
models.UUIDField(
default=uuid.uuid4,
editable=False,
primary_key=True,
serialize=False,
),
),
2016-09-29 20:20:10 +00:00
],
),
migrations.CreateModel(
2023-07-11 13:34:35 +00:00
name="ItemImage",
2016-09-29 20:20:10 +00:00
fields=[
2023-07-11 13:34:35 +00:00
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("image", models.ImageField(upload_to="")),
(
"item",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="images",
to="storage.Item",
),
),
2016-09-29 20:20:10 +00:00
],
),
migrations.CreateModel(
2023-07-11 13:34:35 +00:00
name="Category",
2016-09-29 20:20:10 +00:00
fields=[
2023-07-11 13:34:35 +00:00
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=127)),
2016-09-29 20:20:10 +00:00
],
),
migrations.AddField(
2023-07-11 13:34:35 +00:00
model_name="item",
name="categories",
field=models.ManyToManyField(to="storage.Category"),
2016-09-29 20:20:10 +00:00
),
migrations.AddField(
2023-07-11 13:34:35 +00:00
model_name="item",
name="owner",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="owned_items",
to=settings.AUTH_USER_MODEL,
),
2016-09-29 20:20:10 +00:00
),
migrations.AddField(
2023-07-11 13:34:35 +00:00
model_name="item",
name="taken_by",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="taken_items",
to=settings.AUTH_USER_MODEL,
),
2016-09-29 20:20:10 +00:00
),
migrations.AddField(
2023-07-11 13:34:35 +00:00
model_name="item",
name="taken_on",
2016-09-29 20:20:10 +00:00
field=models.DateTimeField(blank=True, null=True),
),
migrations.AddField(
2023-07-11 13:34:35 +00:00
model_name="item",
name="taken_until",
2016-09-29 20:20:10 +00:00
field=models.DateTimeField(blank=True, null=True),
),
migrations.AlterField(
2023-07-11 13:34:35 +00:00
model_name="item",
name="description",
2016-09-29 20:20:10 +00:00
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
2023-07-11 13:34:35 +00:00
model_name="item",
name="state",
field=models.CharField(
choices=[
("present", "Present"),
("taken", "Taken"),
("broken", "Broken"),
("missing", "Missing"),
],
default="present",
max_length=31,
),
2016-09-29 20:20:10 +00:00
),
]