mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 06:11:07 -05:00
33 lines
1.4 KiB
Python
33 lines
1.4 KiB
Python
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),
|
|
('contenttypes', '0002_remove_content_type_name'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='HistoricalSlug',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('object_id', models.PositiveIntegerField()),
|
|
('slug', models.SlugField(max_length=255)),
|
|
('created_at', models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now)),
|
|
('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')),
|
|
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='historical_slugs', to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
options={
|
|
'unique_together': {('content_type', 'slug')},
|
|
'indexes': [
|
|
models.Index(fields=['content_type', 'object_id'], name='history_tra_content_1234ab_idx'),
|
|
models.Index(fields=['slug'], name='history_tra_slug_1234ab_idx'),
|
|
],
|
|
},
|
|
),
|
|
]
|