Nettoyage, 1ère passe…
[auf_paf.git] / paf / migrations / 0012_auto__del_location__del_country__del_continent__del_area__add_level__c.py
CommitLineData
0ba28d89 1# -*- coding: utf-8 -*-
2import datetime
3from south.db import db
4from south.v2 import SchemaMigration
5from django.db import models
6
7
8class Migration(SchemaMigration):
9
10 def forwards(self, orm):
11 # Deleting model 'Location'
12 db.delete_table('paf_location')
13
14 # Deleting model 'Country'
15 db.delete_table('paf_country')
16
17 # Deleting model 'Continent'
18 db.delete_table('paf_continent')
19
20 # Deleting model 'Area'
21 db.delete_table('paf_area')
22
23 # Adding model 'Level'
24 db.create_table('paf_level', (
25 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
26 ('name', self.gf('django.db.models.fields.CharField')(max_length=100)),
27 ))
28 db.send_create_signal('paf', ['Level'])
29
30
31 # Renaming column for 'CurrentAcademic.level' to match new field type.
32 db.rename_column('paf_currentacademic', 'level', 'level_id')
33 # Changing field 'CurrentAcademic.level'
34 db.alter_column('paf_currentacademic', 'level_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['paf.Level']))
35 # Adding index on 'CurrentAcademic', fields ['level']
36 db.create_index('paf_currentacademic', ['level_id'])
37
38
39 def backwards(self, orm):
40 # Removing index on 'CurrentAcademic', fields ['level']
41 db.delete_index('paf_currentacademic', ['level_id'])
42
43 # Adding model 'Location'
44 db.create_table('paf_location', (
45 ('city', self.gf('django.db.models.fields.CharField')(max_length=50)),
46 ('street', self.gf('django.db.models.fields.CharField')(max_length=100)),
47 ('area', self.gf('smart_selects.db_fields.ChainedForeignKey')(to=orm['paf.Area'])),
48 ('country', self.gf('smart_selects.db_fields.ChainedForeignKey')(to=orm['paf.Country'])),
49 ('continent', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['paf.Continent'])),
50 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
51 ))
52 db.send_create_signal('paf', ['Location'])
53
54 # Adding model 'Country'
55 db.create_table('paf_country', (
56 ('continent', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['paf.Continent'])),
57 ('name', self.gf('django.db.models.fields.CharField')(max_length=100)),
58 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
59 ))
60 db.send_create_signal('paf', ['Country'])
61
62 # Adding model 'Continent'
63 db.create_table('paf_continent', (
64 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
65 ('name', self.gf('django.db.models.fields.CharField')(max_length=100)),
66 ))
67 db.send_create_signal('paf', ['Continent'])
68
69 # Adding model 'Area'
70 db.create_table('paf_area', (
71 ('country', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['paf.Country'])),
72 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
73 ('name', self.gf('django.db.models.fields.CharField')(max_length=100)),
74 ))
75 db.send_create_signal('paf', ['Area'])
76
77 # Deleting model 'Level'
78 db.delete_table('paf_level')
79
80
81 # Renaming column for 'CurrentAcademic.level' to match new field type.
82 db.rename_column('paf_currentacademic', 'level_id', 'level')
83 # Changing field 'CurrentAcademic.level'
84 db.alter_column('paf_currentacademic', 'level', self.gf('django.db.models.fields.CharField')(max_length=200))
85
86 models = {
87 'paf.currentacademic': {
88 'Meta': {'object_name': 'CurrentAcademic'},
89 'faculty': ('smart_selects.db_fields.ChainedForeignKey', [], {'to': "orm['paf.Faculty']"}),
90 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
91 'level': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['paf.Level']"}),
92 'specialty': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
93 'student': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['paf.Student']", 'unique': 'True'}),
94 'university': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['paf.University']"})
95 },
96 'paf.faculty': {
97 'Meta': {'object_name': 'Faculty'},
98 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
99 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
100 'university': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['paf.University']"})
101 },
102 'paf.level': {
103 'Meta': {'object_name': 'Level'},
104 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
105 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
106 },
107 'paf.linguisticlevel': {
108 'Meta': {'object_name': 'LinguisticLevel'},
109 'delf_dalf': ('django.db.models.fields.CharField', [], {'max_length': '2', 'blank': 'True'}),
110 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
111 'other': ('django.db.models.fields.CharField', [], {'max_length': '1', 'blank': 'True'}),
112 'student': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['paf.Student']", 'unique': 'True'}),
113 'year_delf_dalf': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
114 'year_other': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'})
115 },
116 'paf.student': {
117 'Meta': {'object_name': 'Student'},
118 'dob': ('django.db.models.fields.DateField', [], {}),
119 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
120 'firstname': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
121 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
122 'identifier': ('django.db.models.fields.CharField', [], {'max_length': '9', 'blank': 'True'}),
123 'lastname': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
124 'nationality': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
125 'parent_address': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
126 'parent_tel': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
127 'sex': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
128 'tel': ('django.db.models.fields.CharField', [], {'max_length': '20'})
129 },
130 'paf.university': {
131 'Meta': {'object_name': 'University'},
132 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
133 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
134 }
135 }
136
137 complete_apps = ['paf']