reversion
[redakcja.git] / src / isbn / migrations / 0001_initial.py
1 # Generated by Django 4.1.9 on 2023-09-12 18:10
2
3 from django.db import migrations, models
4 import django.db.models.deletion
5
6
7 class Migration(migrations.Migration):
8
9     initial = True
10
11     dependencies = [
12         ("catalogue", "0050_audience_woblink"),
13     ]
14
15     operations = [
16         migrations.CreateModel(
17             name="IsbnPool",
18             fields=[
19                 (
20                     "id",
21                     models.BigAutoField(
22                         auto_created=True,
23                         primary_key=True,
24                         serialize=False,
25                         verbose_name="ID",
26                     ),
27                 ),
28                 ("prefix", models.CharField(max_length=10)),
29                 ("suffix_from", models.IntegerField()),
30                 ("suffix_to", models.IntegerField()),
31                 ("ref_from", models.IntegerField()),
32                 (
33                     "purpose",
34                     models.CharField(
35                         choices=[("WL", "Wolne Lektury"), ("GENERAL", "Ogólne")],
36                         max_length=8,
37                     ),
38                 ),
39             ],
40         ),
41         migrations.CreateModel(
42             name="Isbn",
43             fields=[
44                 (
45                     "id",
46                     models.BigAutoField(
47                         auto_created=True,
48                         primary_key=True,
49                         serialize=False,
50                         verbose_name="ID",
51                     ),
52                 ),
53                 ("datestamp", models.DateField()),
54                 ("suffix", models.IntegerField()),
55                 ("form", models.CharField(choices=[], max_length=32)),
56                 (
57                     "book",
58                     models.ForeignKey(
59                         on_delete=django.db.models.deletion.PROTECT, to="catalogue.book"
60                     ),
61                 ),
62                 (
63                     "pool",
64                     models.ForeignKey(
65                         on_delete=django.db.models.deletion.PROTECT, to="isbn.isbnpool"
66                     ),
67                 ),
68             ],
69             options={
70                 "ordering": ["pool", "suffix"],
71                 "unique_together": {("pool", "suffix")},
72             },
73         ),
74     ]