From 019f463953a09e7b2fe4ba8d4fa344bbf8c67164 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20St=C4=99pniowski?= Date: Thu, 8 Oct 2009 16:43:14 +0200 Subject: [PATCH 1/1] Poprawienie migracji. --- apps/catalogue/migrations/0002_add_extra_info_to_book.py | 2 +- .../migrations/0003_add_mp3_and_ogg_files_to_book.py | 4 ++-- apps/catalogue/migrations/0004_add_gazeta_links.py | 4 ++-- apps/catalogue/migrations/0005_add_wiki_links.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) 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') -- 2.20.1