Migré les migrations sous le contrôle de South
[auf_savoirs_en_partage_django.git] / auf_savoirs_en_partage / sitotheque / migrations / 0001_initial.py
1 # encoding: utf-8
2 import datetime
3 from south.db import db
4 from south.v2 import SchemaMigration
5 from django.db import models
6
7 class Migration(SchemaMigration):
8
9 def forwards(self, orm):
10
11 # Adding model 'Site'
12 db.create_table('sitotheque_site', (
13 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14 ('url', self.gf('django.db.models.fields.URLField')(max_length=200)),
15 ('titre', self.gf('django.db.models.fields.CharField')(max_length=255)),
16 ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
17 ('editeur', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
18 ('auteur', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
19 ('date_publication', self.gf('django.db.models.fields.DateField')(null=True, blank=True)),
20 ('type', self.gf('django.db.models.fields.CharField')(max_length=2, null=True, blank=True)),
21 ('mots_cles', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
22 ('pays', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['datamaster_modeles.Pays'], null=True, db_column='pays', blank=True)),
23 ('actif', self.gf('django.db.models.fields.BooleanField')(default=True)),
24 ('date_maj', self.gf('django.db.models.fields.DateField')(auto_now=True, blank=True)),
25 ))
26 db.send_create_signal('sitotheque', ['Site'])
27
28 # Adding M2M table for field discipline on 'Site'
29 db.create_table('sitotheque_site_discipline', (
30 ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
31 ('site', models.ForeignKey(orm['sitotheque.site'], null=False)),
32 ('discipline', models.ForeignKey(orm['savoirs.discipline'], null=False))
33 ))
34 db.create_unique('sitotheque_site_discipline', ['site_id', 'discipline_id'])
35
36 # Adding M2M table for field thematique on 'Site'
37 db.create_table('sitotheque_site_thematique', (
38 ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
39 ('site', models.ForeignKey(orm['sitotheque.site'], null=False)),
40 ('thematique', models.ForeignKey(orm['datamaster_modeles.thematique'], null=False))
41 ))
42 db.create_unique('sitotheque_site_thematique', ['site_id', 'thematique_id'])
43
44 # Adding M2M table for field regions on 'Site'
45 db.create_table('sitotheque_site_regions', (
46 ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
47 ('site', models.ForeignKey(orm['sitotheque.site'], null=False)),
48 ('region', models.ForeignKey(orm['datamaster_modeles.region'], null=False))
49 ))
50 db.create_unique('sitotheque_site_regions', ['site_id', 'region_id'])
51
52
53 def backwards(self, orm):
54
55 # Deleting model 'Site'
56 db.delete_table('sitotheque_site')
57
58 # Removing M2M table for field discipline on 'Site'
59 db.delete_table('sitotheque_site_discipline')
60
61 # Removing M2M table for field thematique on 'Site'
62 db.delete_table('sitotheque_site_thematique')
63
64 # Removing M2M table for field regions on 'Site'
65 db.delete_table('sitotheque_site_regions')
66
67
68 models = {
69 'datamaster_modeles.bureau': {
70 'Meta': {'object_name': 'Bureau', 'db_table': "u'ref_bureau'"},
71 'actif': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
72 'code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'unique': 'True'}),
73 'id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),
74 'implantation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['datamaster_modeles.Implantation']", 'db_column': "'implantation'"}),
75 'nom': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
76 'nom_court': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
77 'nom_long': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
78 'region': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['datamaster_modeles.Region']", 'db_column': "'region'"})
79 },
80 'datamaster_modeles.implantation': {
81 'Meta': {'ordering': "('nom',)", 'object_name': 'Implantation', 'db_table': "u'ref_implantation'"},
82 'actif': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
83 'adresse_physique_bureau': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
84 'adresse_physique_code_postal': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
85 'adresse_physique_code_postal_avant_ville': ('django.db.models.fields.NullBooleanField', [], {'null': 'True'}),
86 'adresse_physique_no': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
87 'adresse_physique_pays': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'impl_adresse_physique'", 'db_column': "'adresse_physique_pays'", 'to': "orm['datamaster_modeles.Pays']"}),
88 'adresse_physique_precision': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
89 'adresse_physique_precision_avant': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
90 'adresse_physique_region': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
91 'adresse_physique_rue': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
92 'adresse_physique_ville': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
93 'adresse_postale_boite_postale': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
94 'adresse_postale_bureau': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
95 'adresse_postale_code_postal': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
96 'adresse_postale_code_postal_avant_ville': ('django.db.models.fields.NullBooleanField', [], {'null': 'True'}),
97 'adresse_postale_no': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
98 'adresse_postale_pays': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'impl_adresse_postale'", 'db_column': "'adresse_postale_pays'", 'to': "orm['datamaster_modeles.Pays']"}),
99 'adresse_postale_precision': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
100 'adresse_postale_precision_avant': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
101 'adresse_postale_region': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
102 'adresse_postale_rue': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
103 'adresse_postale_ville': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
104 'bureau_rattachement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['datamaster_modeles.Implantation']", 'db_column': "'bureau_rattachement'"}),
105 'code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'unique': 'True'}),
106 'code_meteo': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
107 'commentaire': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
108 'courriel': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
109 'courriel_interne': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
110 'date_extension': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
111 'date_fermeture': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
112 'date_inauguration': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
113 'date_ouverture': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
114 'fax': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
115 'fax_interne': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
116 'fuseau_horaire': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
117 'hebergement_convention': ('django.db.models.fields.NullBooleanField', [], {'null': 'True'}),
118 'hebergement_convention_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
119 'hebergement_etablissement': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
120 'id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),
121 'modif_date': ('django.db.models.fields.DateField', [], {}),
122 'nom': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
123 'nom_court': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
124 'nom_long': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
125 'region': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['datamaster_modeles.Region']", 'db_column': "'region'"}),
126 'remarque': ('django.db.models.fields.TextField', [], {}),
127 'responsable_implantation': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
128 'statut': ('django.db.models.fields.IntegerField', [], {}),
129 'telephone': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
130 'telephone_interne': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
131 'type': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
132 'url': ('django.db.models.fields.URLField', [], {'max_length': '255', 'blank': 'True'})
133 },
134 'datamaster_modeles.pays': {
135 'Meta': {'ordering': "('nom',)", 'object_name': 'Pays', 'db_table': "u'ref_pays'"},
136 'actif': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
137 'code': ('django.db.models.fields.CharField', [], {'max_length': '2', 'primary_key': 'True'}),
138 'code_bureau': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['datamaster_modeles.Bureau']", 'to_field': "'code'", 'db_column': "'code_bureau'"}),
139 'code_iso3': ('django.db.models.fields.CharField', [], {'max_length': '3', 'unique': 'True', 'blank': 'True'}),
140 'developpement': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
141 'id': ('django.db.models.fields.IntegerField', [], {}),
142 'monnaie': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
143 'nom': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
144 'nord_sud': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
145 'region': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['datamaster_modeles.Region']", 'db_column': "'region'"})
146 },
147 'datamaster_modeles.region': {
148 'Meta': {'object_name': 'Region', 'db_table': "u'ref_region'"},
149 'actif': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
150 'code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'unique': 'True'}),
151 'id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),
152 'implantation_bureau': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'gere_region'", 'db_column': "'implantation_bureau'", 'to': "orm['datamaster_modeles.Implantation']"}),
153 'nom': ('django.db.models.fields.CharField', [], {'max_length': '255'})
154 },
155 'datamaster_modeles.thematique': {
156 'Meta': {'object_name': 'Thematique', 'db_table': "u'ref_thematique'"},
157 'actif': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
158 'id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),
159 'nom': ('django.db.models.fields.CharField', [], {'max_length': '255'})
160 },
161 'savoirs.discipline': {
162 'Meta': {'ordering': "['nom']", 'object_name': 'Discipline', 'db_table': "u'discipline'"},
163 'id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True', 'db_column': "'id_discipline'"}),
164 'nom': ('django.db.models.fields.CharField', [], {'max_length': '765', 'db_column': "'nom_discipline'"})
165 },
166 'sitotheque.site': {
167 'Meta': {'object_name': 'Site'},
168 'actif': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
169 'auteur': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
170 'date_maj': ('django.db.models.fields.DateField', [], {'auto_now': 'True', 'blank': 'True'}),
171 'date_publication': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
172 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
173 'discipline': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['savoirs.Discipline']", 'blank': 'True'}),
174 'editeur': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
175 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
176 'mots_cles': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
177 'pays': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['datamaster_modeles.Pays']", 'null': 'True', 'db_column': "'pays'", 'blank': 'True'}),
178 'regions': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'sites'", 'blank': 'True', 'to': "orm['datamaster_modeles.Region']"}),
179 'thematique': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['datamaster_modeles.Thematique']", 'blank': 'True'}),
180 'titre': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
181 'type': ('django.db.models.fields.CharField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}),
182 'url': ('django.db.models.fields.URLField', [], {'max_length': '200'})
183 }
184 }
185
186 complete_apps = ['sitotheque']