def forwards(self, orm):
# Adding field 'BookMedia.book'
- db.add_column('catalogue_bookmedia', 'book', self.gf('django.db.models.fields.related.ForeignKey')(default=0, related_name='media', to=orm['catalogue.Book']), keep_default=False)
+ db.add_column('catalogue_bookmedia', 'book', self.gf('django.db.models.fields.related.ForeignKey')(related_name='media', null=True, to=orm['catalogue.Book']), keep_default=False)
def backwards(self, orm):
},
'catalogue.bookmedia': {
'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'},
- 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}),
+ 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'null': 'True', 'to': "orm['catalogue.Book']"}),
'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}),
'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
},
'catalogue.bookmedia': {
'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'},
- 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}),
+ 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'null': 'True', 'to': "orm['catalogue.Book']"}),
'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}),
'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
# Removing M2M table for field medias on 'Book'
db.delete_table('catalogue_book_medias')
+ # Changing field 'BookMedia.book'
+ db.alter_column('catalogue_bookmedia', 'book_id', self.gf('django.db.models.fields.related.ForeignKey')(default=0, to=orm['catalogue.Book']))
+
def backwards(self, orm):
))
db.create_unique('catalogue_book_medias', ['book_id', 'bookmedia_id'])
+ # Changing field 'BookMedia.book'
+ db.alter_column('catalogue_bookmedia', 'book_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['catalogue.Book']))
+
models = {
'auth.group': {