carto_1_1 premier migration des modèles avec South
authorDavin Baragiotta <davin.baragiotta@auf.org>
Thu, 30 Aug 2012 21:22:08 +0000 (17:22 -0400)
committerDavin BARAGIOTTA <davin.baragiotta@auf.org>
Thu, 30 Aug 2012 21:22:08 +0000 (17:22 -0400)
ateliers/django/carto_1_1/annuaire/migrations/0001_initial.py [new file with mode: 0644]
ateliers/django/carto_1_1/annuaire/migrations/__init__.py [new file with mode: 0644]

diff --git a/ateliers/django/carto_1_1/annuaire/migrations/0001_initial.py b/ateliers/django/carto_1_1/annuaire/migrations/0001_initial.py
new file mode 100644 (file)
index 0000000..3bb6a1c
--- /dev/null
@@ -0,0 +1,48 @@
+# -*- encoding: utf-8 -*-
+
+from south.db import db
+from django.db import models
+from annuaire.models import *
+
+class Migration:
+    
+    def forwards(self, orm):
+        
+        # Adding model 'Etablissement'
+        db.create_table('annuaire_etablissement', (
+            ('id', orm['annuaire.Etablissement:id']),
+            ('nom', orm['annuaire.Etablissement:nom']),
+        ))
+        db.send_create_signal('annuaire', ['Etablissement'])
+        
+        # Adding model 'Personne'
+        db.create_table('annuaire_personne', (
+            ('id', orm['annuaire.Personne:id']),
+            ('nom', orm['annuaire.Personne:nom']),
+        ))
+        db.send_create_signal('annuaire', ['Personne'])
+        
+    
+    
+    def backwards(self, orm):
+        
+        # Deleting model 'Etablissement'
+        db.delete_table('annuaire_etablissement')
+        
+        # Deleting model 'Personne'
+        db.delete_table('annuaire_personne')
+        
+    
+    
+    models = {
+        'annuaire.etablissement': {
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'nom': ('django.db.models.fields.CharField', [], {'max_length': '255'})
+        },
+        'annuaire.personne': {
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'nom': ('django.db.models.fields.CharField', [], {'max_length': '255'})
+        }
+    }
+    
+    complete_apps = ['annuaire']
diff --git a/ateliers/django/carto_1_1/annuaire/migrations/__init__.py b/ateliers/django/carto_1_1/annuaire/migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29