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 'Department'
12 db.create_table('courses_department', (
13 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14 ('name', self.gf('django.db.models.fields.CharField')(max_length=255)),
15 ('school', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['courses.School'])),
16 ('slug', self.gf('django.db.models.fields.SlugField')(max_length=150, null=True)),
17 ('url', self.gf('django.db.models.fields.URLField')(max_length=511, null=True, blank=True)),
19 db.send_create_signal('courses', ['Department'])
21 # Deleting field 'Course.academic_year'
22 db.delete_column('courses_course', 'academic_year')
24 # Adding field 'Course.department'
25 db.add_column('courses_course', 'department',
26 self.gf('django.db.models.fields.related.ForeignKey')(to=orm['courses.Department'], null=True, blank=True),
30 def backwards(self, orm):
31 # Deleting model 'Department'
32 db.delete_table('courses_department')
34 # Adding field 'Course.academic_year'
35 db.add_column('courses_course', 'academic_year',
36 self.gf('django.db.models.fields.IntegerField')(default=2014, null=True, blank=True),
39 # Deleting field 'Course.department'
40 db.delete_column('courses_course', 'department_id')
45 'Meta': {'ordering': "['-file_count', 'school', 'name']", 'unique_together': "(('school', 'name', 'instructor_name'),)", 'object_name': 'Course'},
46 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
47 'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['courses.Department']", 'null': 'True', 'blank': 'True'}),
48 'desc': ('django.db.models.fields.TextField', [], {'max_length': '511', 'null': 'True', 'blank': 'True'}),
49 'file_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
50 'flags': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
51 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
52 'instructor_email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
53 'instructor_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
54 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
55 'school': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['courses.School']"}),
56 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '150', 'null': 'True'}),
57 'updated_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.utcnow'}),
58 'url': ('django.db.models.fields.URLField', [], {'max_length': '511', 'null': 'True', 'blank': 'True'})
60 'courses.department': {
61 'Meta': {'object_name': 'Department'},
62 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
63 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
64 'school': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['courses.School']"}),
65 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '150', 'null': 'True'}),
66 'url': ('django.db.models.fields.URLField', [], {'max_length': '511', 'null': 'True', 'blank': 'True'})
69 'Meta': {'ordering': "['-file_count', '-priority', 'name']", 'object_name': 'School'},
70 'alias': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
71 'facebook_id': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}),
72 'file_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
73 'hashtag': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}),
74 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
75 'location': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
76 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
77 'priority': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
78 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '150', 'null': 'True'}),
79 'url': ('django.db.models.fields.URLField', [], {'max_length': '511', 'blank': 'True'}),
80 'usde_id': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'})
84 complete_apps = ['courses']