From: Marek Stępniowski Date: Thu, 8 Oct 2009 14:43:14 +0000 (+0200) Subject: Poprawienie migracji. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/019f463953a09e7b2fe4ba8d4fa344bbf8c67164?ds=sidebyside;hp=6c984d51262f63e88ae8ffb8e6611ea2dd406471 Poprawienie migracji. --- diff --git a/apps/catalogue/migrations/0002_add_extra_info_to_book.py b/apps/catalogue/migrations/0002_add_extra_info_to_book.py index 145d7116c..648aa097f 100644 --- a/apps/catalogue/migrations/0002_add_extra_info_to_book.py +++ b/apps/catalogue/migrations/0002_add_extra_info_to_book.py @@ -4,7 +4,7 @@ from catalogue.fields import JSONField class Migration: def forwards(self): - db.add_column('catalogue_book', 'extra_info', JSONField()) + db.add_column('catalogue_book', 'extra_info', JSONField(null=False, default='{}')) def backwards(self): db.delete_column('catalogue_book', 'extra_info') diff --git a/apps/catalogue/migrations/0003_add_mp3_and_ogg_files_to_book.py b/apps/catalogue/migrations/0003_add_mp3_and_ogg_files_to_book.py index f4fab130e..80d94c049 100644 --- a/apps/catalogue/migrations/0003_add_mp3_and_ogg_files_to_book.py +++ b/apps/catalogue/migrations/0003_add_mp3_and_ogg_files_to_book.py @@ -4,8 +4,8 @@ from django.db.models import FileField class Migration: def forwards(self): - db.add_column('catalogue_book', 'mp3_file', FileField()) - db.add_column('catalogue_book', 'ogg_file', FileField()) + db.add_column('catalogue_book', 'mp3_file', FileField(null=True)) + db.add_column('catalogue_book', 'ogg_file', FileField(null=True)) def backwards(self): db.delete_column('catalogue_book', 'mp3_file') diff --git a/apps/catalogue/migrations/0004_add_gazeta_links.py b/apps/catalogue/migrations/0004_add_gazeta_links.py index d750a673f..1e8457d29 100644 --- a/apps/catalogue/migrations/0004_add_gazeta_links.py +++ b/apps/catalogue/migrations/0004_add_gazeta_links.py @@ -5,8 +5,8 @@ from django.db import models class Migration: def forwards(self): - db.add_column('catalogue_tag', 'gazeta_link', models.CharField(blank=True, max_length=240)) - db.add_column('catalogue_book', 'gazeta_link', models.CharField(blank=True, max_length=240)) + db.add_column('catalogue_tag', 'gazeta_link', models.CharField(blank=True, max_length=240, default='')) + db.add_column('catalogue_book', 'gazeta_link', models.CharField(blank=True, max_length=240, default='')) def backwards(self): db.delete_column('catalogue_tag', 'gazeta_link') diff --git a/apps/catalogue/migrations/0005_add_wiki_links.py b/apps/catalogue/migrations/0005_add_wiki_links.py index 3ac91df21..3fb423ae3 100644 --- a/apps/catalogue/migrations/0005_add_wiki_links.py +++ b/apps/catalogue/migrations/0005_add_wiki_links.py @@ -5,8 +5,8 @@ from django.db import models class Migration: def forwards(self): - db.add_column('catalogue_tag', 'wiki_link', models.CharField(blank=True, max_length=240)) - db.add_column('catalogue_book', 'wiki_link', models.CharField(blank=True, max_length=240)) + db.add_column('catalogue_tag', 'wiki_link', models.CharField(blank=True, max_length=240, default='')) + db.add_column('catalogue_book', 'wiki_link', models.CharField(blank=True, max_length=240, default='')) def backwards(self): db.delete_column('catalogue_tag', 'wiki_link')