From 2e430d53709feaa0e0ebd7f5074e4a5e8af09b83 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 7 May 2012 10:57:36 +0200 Subject: [PATCH] Minor code cleanup of the migrations. --- dbtemplates/migrations/0001_initial.py | 6 ++---- .../migrations/0002_auto__del_unique_template_name.py | 7 +------ 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/dbtemplates/migrations/0001_initial.py b/dbtemplates/migrations/0001_initial.py index a5192af..0e08603 100644 --- a/dbtemplates/migrations/0001_initial.py +++ b/dbtemplates/migrations/0001_initial.py @@ -4,10 +4,11 @@ from south.db import db from south.v2 import SchemaMigration from django.db import models + class Migration(SchemaMigration): def forwards(self, orm): - + # Adding model 'Template' db.create_table('django_template', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), @@ -26,16 +27,13 @@ class Migration(SchemaMigration): )) db.create_unique('django_template_sites', ['template_id', 'site_id']) - def backwards(self, orm): - # Deleting model 'Template' db.delete_table('django_template') # Removing M2M table for field sites on 'Template' db.delete_table('django_template_sites') - models = { 'dbtemplates.template': { 'Meta': {'ordering': "('name',)", 'object_name': 'Template', 'db_table': "'django_template'"}, diff --git a/dbtemplates/migrations/0002_auto__del_unique_template_name.py b/dbtemplates/migrations/0002_auto__del_unique_template_name.py index 17a8a6e..418a3ab 100644 --- a/dbtemplates/migrations/0002_auto__del_unique_template_name.py +++ b/dbtemplates/migrations/0002_auto__del_unique_template_name.py @@ -1,23 +1,18 @@ # encoding: 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): - # Removing unique constraint on 'Template', fields ['name'] db.delete_unique('django_template', ['name']) - def backwards(self, orm): - # Adding unique constraint on 'Template', fields ['name'] db.create_unique('django_template', ['name']) - models = { 'dbtemplates.template': { 'Meta': {'ordering': "('name',)", 'object_name': 'Template', 'db_table': "'django_template'"},