1 # -*- coding: utf-8 -*-
3 from south.db import db
4 from south.v2 import SchemaMigration
5 from django.db import models
8 class Migration(SchemaMigration):
10 def forwards(self, orm):
11 # Adding model 'Catalog'
12 db.create_table(u'libraries_catalog', (
13 (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14 ('name', self.gf('django.db.models.fields.CharField')(max_length=120)),
15 ('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=120)),
17 db.send_create_signal(u'libraries', ['Catalog'])
19 # Adding field 'Library.catalog'
20 db.add_column(u'libraries_library', 'catalog',
21 self.gf('django.db.models.fields.related.ForeignKey')(default=None, related_name='libraries', on_delete=models.PROTECT, to=orm['libraries.Catalog']),
25 def backwards(self, orm):
26 # Deleting model 'Catalog'
27 db.delete_table(u'libraries_catalog')
29 # Deleting field 'Library.catalog'
30 db.delete_column(u'libraries_library', 'catalog_id')
34 u'libraries.catalog': {
35 'Meta': {'object_name': 'Catalog'},
36 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
37 'name': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
38 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120'})
40 u'libraries.library': {
41 'Meta': {'object_name': 'Library'},
42 'catalog': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'libraries'", 'on_delete': 'models.PROTECT', 'to': u"orm['libraries.Catalog']"}),
43 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
44 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
45 'name': ('django.db.models.fields.CharField', [], {'max_length': '120', 'blank': 'True'}),
46 'url': ('django.db.models.fields.CharField', [], {'max_length': '120', 'blank': 'True'})
50 complete_apps = ['libraries']