carto_1_1 premier migration des modèles avec South
[davin.git] / ateliers / django / carto_1_1 / annuaire / migrations / 0001_initial.py
1 # -*- encoding: utf-8 -*-
2
3 from south.db import db
4 from django.db import models
5 from annuaire.models import *
6
7 class Migration:
8
9 def forwards(self, orm):
10
11 # Adding model 'Etablissement'
12 db.create_table('annuaire_etablissement', (
13 ('id', orm['annuaire.Etablissement:id']),
14 ('nom', orm['annuaire.Etablissement:nom']),
15 ))
16 db.send_create_signal('annuaire', ['Etablissement'])
17
18 # Adding model 'Personne'
19 db.create_table('annuaire_personne', (
20 ('id', orm['annuaire.Personne:id']),
21 ('nom', orm['annuaire.Personne:nom']),
22 ))
23 db.send_create_signal('annuaire', ['Personne'])
24
25
26
27 def backwards(self, orm):
28
29 # Deleting model 'Etablissement'
30 db.delete_table('annuaire_etablissement')
31
32 # Deleting model 'Personne'
33 db.delete_table('annuaire_personne')
34
35
36
37 models = {
38 'annuaire.etablissement': {
39 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
40 'nom': ('django.db.models.fields.CharField', [], {'max_length': '255'})
41 },
42 'annuaire.personne': {
43 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
44 'nom': ('django.db.models.fields.CharField', [], {'max_length': '255'})
45 }
46 }
47
48 complete_apps = ['annuaire']