3 from south.db import db
4 from south.v2 import SchemaMigration
5 from django.db import models
7 class Migration(SchemaMigration):
9 def forwards(self, orm):
11 # Adding field 'Site.term'
12 db.add_column('syrup_site', 'term', self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['syrup.Term']), keep_default=False)
14 # Adding field 'Site.course'
15 db.add_column('syrup_site', 'course', self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['syrup.Course']), keep_default=False)
17 # Removing M2M table for field courses on 'Site'
18 db.delete_table('syrup_site_courses')
20 # Removing M2M table for field terms on 'Site'
21 db.delete_table('syrup_site_terms')
23 # Adding unique constraint on 'Site', fields ['owner', 'course', 'term']
24 db.create_unique('syrup_site', ['owner_id', 'course_id', 'term_id'])
27 def backwards(self, orm):
29 # Deleting field 'Site.term'
30 db.delete_column('syrup_site', 'term_id')
32 # Deleting field 'Site.course'
33 db.delete_column('syrup_site', 'course_id')
35 # Adding M2M table for field courses on 'Site'
36 db.create_table('syrup_site_courses', (
37 ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
38 ('site', models.ForeignKey(orm['syrup.site'], null=False)),
39 ('course', models.ForeignKey(orm['syrup.course'], null=False))
41 db.create_unique('syrup_site_courses', ['site_id', 'course_id'])
43 # Adding M2M table for field terms on 'Site'
44 db.create_table('syrup_site_terms', (
45 ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
46 ('site', models.ForeignKey(orm['syrup.site'], null=False)),
47 ('term', models.ForeignKey(orm['syrup.term'], null=False))
49 db.create_unique('syrup_site_terms', ['site_id', 'term_id'])
51 # Removing unique constraint on 'Site', fields ['owner', 'course', 'term']
52 db.delete_unique('syrup_site', ['owner_id', 'course_id', 'term_id'])
57 'Meta': {'object_name': 'Group'},
58 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
59 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
60 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})
63 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
64 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
65 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
66 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
67 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
70 'Meta': {'object_name': 'User'},
71 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
72 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
73 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
74 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),
75 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
76 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
77 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
78 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
79 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
80 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
81 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
82 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),
83 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
85 'contenttypes.contenttype': {
86 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
87 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
88 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
89 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
90 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
93 'Meta': {'object_name': 'Config'},
94 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
95 'name': ('django.db.models.fields.CharField', [], {'max_length': '256'}),
96 'value': ('django.db.models.fields.CharField', [], {'max_length': '8192'})
99 'Meta': {'object_name': 'Course'},
100 'code': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
101 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
102 'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['syrup.Department']"}),
103 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
104 'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
105 'name': ('django.db.models.fields.CharField', [], {'max_length': '1024'})
107 'syrup.department': {
108 'Meta': {'object_name': 'Department'},
109 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
110 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
111 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
112 'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
113 'name': ('django.db.models.fields.CharField', [], {'max_length': '256'}),
114 'service_desk': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['syrup.ServiceDesk']"})
117 'Meta': {'object_name': 'Group'},
118 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
119 'external_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}),
120 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
121 'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
122 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['syrup.Site']"})
125 'Meta': {'object_name': 'Item'},
126 'author': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '8192', 'null': 'True', 'blank': 'True'}),
127 'bib_id': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
128 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
129 'fileobj': ('django.db.models.fields.files.FileField', [], {'default': 'None', 'max_length': '255', 'null': 'True', 'blank': 'True'}),
130 'fileobj_mimetype': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
131 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
132 'item_type': ('django.db.models.fields.CharField', [], {'max_length': '7'}),
133 'itemtype': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '1', 'null': 'True', 'blank': 'True'}),
134 'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
135 'marcxml': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
136 'parent_heading': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['syrup.Item']", 'null': 'True', 'blank': 'True'}),
137 'published': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
138 'publisher': ('django.db.models.fields.CharField', [], {'max_length': '8192', 'null': 'True', 'blank': 'True'}),
139 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['syrup.Site']"}),
140 'title': ('django.db.models.fields.CharField', [], {'max_length': '8192', 'db_index': 'True'}),
141 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
143 'syrup.membership': {
144 'Meta': {'unique_together': "(('group', 'user'),)", 'object_name': 'Membership'},
145 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
146 'group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['syrup.Group']"}),
147 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
148 'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
149 'role': ('django.db.models.fields.CharField', [], {'default': "'STUDT'", 'max_length': '6'}),
150 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
152 'syrup.servicedesk': {
153 'Meta': {'object_name': 'ServiceDesk'},
154 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
155 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
156 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
157 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
158 'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
159 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
162 'Meta': {'unique_together': "(('course', 'term', 'owner'),)", 'object_name': 'Site'},
163 'access': ('django.db.models.fields.CharField', [], {'default': "'CLOSE'", 'max_length': '5'}),
164 'course': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['syrup.Course']"}),
165 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
166 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
167 'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
168 'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
169 'passkey': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '256', 'null': 'True', 'blank': 'True'}),
170 'service_desk': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['syrup.ServiceDesk']"}),
171 'term': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['syrup.Term']"})
174 'Meta': {'object_name': 'Term'},
175 'code': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
176 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
177 'finish': ('django.db.models.fields.DateField', [], {}),
178 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
179 'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
180 'name': ('django.db.models.fields.CharField', [], {'max_length': '256'}),
181 'start': ('django.db.models.fields.DateField', [], {})
183 'syrup.userprofile': {
184 'Meta': {'object_name': 'UserProfile'},
185 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
186 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
187 'ils_userid': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
188 'last_email_notice': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True', 'blank': 'True'}),
189 'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
190 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
191 'wants_email_notices': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'})
193 'syrup.z3950target': {
194 'Meta': {'object_name': 'Z3950Target'},
195 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
196 'database': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
197 'host': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
198 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
199 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
200 'port': ('django.db.models.fields.IntegerField', [], {'default': '210'}),
201 'syntax': ('django.db.models.fields.CharField', [], {'default': "'USMARC'", 'max_length': '10'})
205 complete_apps = ['syrup']