muistox/gallery/migrations/0001_initial.py

53 lines
2.1 KiB
Python
Raw Normal View History

2024-12-29 23:25:03 +02:00
# Generated by Django 5.1.4 on 2024-12-29 21:23
2024-12-29 17:35:10 +02:00
2024-12-29 23:25:03 +02:00
import datetime
2024-12-29 17:35:10 +02:00
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='City',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=150, unique=True, verbose_name='City')),
],
options={
'verbose_name_plural': 'Cities',
},
),
migrations.CreateModel(
name='Location',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('place', models.CharField(blank=True, max_length=250, verbose_name='Place')),
('city', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='places', to='gallery.city', verbose_name='City')),
],
options={
'verbose_name_plural': 'Locations',
'unique_together': {('place', 'city')},
},
),
2024-12-29 23:25:03 +02:00
migrations.CreateModel(
name='Album',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=150, unique=True, verbose_name='Album')),
('slug', models.SlugField(max_length=150, unique=True, verbose_name='Slug')),
('album_date', models.DateField(default=datetime.datetime.now, verbose_name='Album Date')),
('is_public', models.BooleanField(default=False, verbose_name='Published')),
('location', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='albums', to='gallery.location', verbose_name='Location')),
],
options={
'verbose_name_plural': 'Albums',
},
),
2024-12-29 17:35:10 +02:00
]