Commits

Simon Meers committed 5fd9946

with initial migration

  • Participants
  • Parent commits 4c06d9d

Comments (0)

Files changed (2)

File gallery/migrations/0001_initial.py

+# -*- coding: utf-8 -*-
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+
+class Migration(SchemaMigration):
+
+    def forwards(self, orm):
+        # Adding model 'Gallery'
+        db.create_table('gallery_gallery', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
+            ('title', self.gf('django.db.models.fields.CharField')(max_length=255)),
+        ))
+        db.send_create_signal('gallery', ['Gallery'])
+
+        # Adding model 'Photo'
+        db.create_table('gallery_photo', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
+            ('gallery', self.gf('django.db.models.fields.related.ForeignKey')(related_name='photos', to=orm['gallery.Gallery'])),
+            ('photo', self.gf('django.db.models.fields.files.ImageField')(max_length=255)),
+            ('caption', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)),
+        ))
+        db.send_create_signal('gallery', ['Photo'])
+
+
+    def backwards(self, orm):
+        # Deleting model 'Gallery'
+        db.delete_table('gallery_gallery')
+
+        # Deleting model 'Photo'
+        db.delete_table('gallery_photo')
+
+
+    models = {
+        'gallery.gallery': {
+            'Meta': {'ordering': "('created',)", 'object_name': 'Gallery'},
+            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'})
+        },
+        'gallery.photo': {
+            'Meta': {'ordering': "('created',)", 'object_name': 'Photo'},
+            'caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
+            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+            'gallery': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'photos'", 'to': "orm['gallery.Gallery']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'photo': ('django.db.models.fields.files.ImageField', [], {'max_length': '255'})
+        }
+    }
+
+    complete_apps = ['gallery']

File gallery/migrations/__init__.py

Empty file added.