Fix webapp migrations

This commit is contained in:
Aarni Halinen
2018-11-18 13:46:31 +02:00
parent 316ab679f8
commit 97e6ce3d8d
2 changed files with 96 additions and 0 deletions
@@ -0,0 +1,17 @@
# Generated by Django 2.0.7 on 2018-11-18 11:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('webapp', '0047_auto_20180710_2110'),
]
operations = [
migrations.DeleteModel('tag'),
migrations.DeleteModel('feed'),
migrations.DeleteModel('event'),
migrations.DeleteModel('basefeed'),
]
@@ -0,0 +1,79 @@
# Generated by Django 2.0.7 on 2018-11-18 11:44
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import webapp.utils
class Migration(migrations.Migration):
dependencies = [
('webapp', '0048_auto_20181118_1336'),
]
operations = [
migrations.CreateModel(
name='BaseFeed',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('visible', models.BooleanField(default=True)),
('title', models.CharField(max_length=255)),
('title_fi', models.CharField(max_length=255, null=True)),
('title_en', models.CharField(max_length=255, null=True)),
('description', models.CharField(max_length=255)),
('description_fi', models.CharField(max_length=255, null=True)),
('description_en', models.CharField(max_length=255, null=True)),
('content', models.TextField()),
('content_fi', models.TextField(null=True)),
('content_en', models.TextField(null=True)),
],
),
migrations.CreateModel(
name='Tag',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('slug', models.SlugField(unique=True)),
('name', models.CharField(max_length=127)),
('name_fi', models.CharField(max_length=127, null=True)),
('name_en', models.CharField(max_length=127, null=True)),
('icon', models.ImageField(upload_to='')),
],
options={
'verbose_name': 'Tag',
'verbose_name_plural': 'Tags',
},
),
migrations.CreateModel(
name='Event',
fields=[
('basefeed_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='webapp.BaseFeed')),
('start_time', models.DateTimeField(default=django.utils.timezone.now)),
('end_time', models.DateTimeField(default=django.utils.timezone.now)),
('signupForm', models.ManyToManyField(blank=True, to='webapp.SignupForm')),
],
options={
'verbose_name': 'Event',
'verbose_name_plural': 'Events',
},
bases=('webapp.basefeed',),
),
migrations.CreateModel(
name='Feed',
fields=[
('basefeed_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='webapp.BaseFeed')),
('publish_time', models.DateTimeField(default=django.utils.timezone.now)),
('autohide', models.DateTimeField(default=webapp.utils.month_from_now)),
],
options={
'verbose_name': 'Feed',
'verbose_name_plural': 'Feeds',
},
bases=('webapp.basefeed',),
),
migrations.AddField(
model_name='basefeed',
name='tags',
field=models.ManyToManyField(blank=True, related_name='feeds', to='webapp.Tag'),
),
]