From e35ad5dd8e3e776d39a13d1f6cd18c3fa4d49b27 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 26 Apr 2012 11:55:18 -0500 Subject: Convert old index addition migration to new format This moves it to the new class-based extending SchemaMigration format, in hopes that it will play nicer when starting and migrating from scratch. Signed-off-by: Dan McGee --- main/migrations/0004_add_pkgname_index.py | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/main/migrations/0004_add_pkgname_index.py b/main/migrations/0004_add_pkgname_index.py index aeb85b2e..0aae4522 100644 --- a/main/migrations/0004_add_pkgname_index.py +++ b/main/migrations/0004_add_pkgname_index.py @@ -1,34 +1,18 @@ - +# encoding: utf-8 from south.db import db +from south.v2 import SchemaMigration from django.db import models -from main.models import * -class Migration: +class Migration(SchemaMigration): def forwards(self, orm): - - # Changing field 'Package.maintainer' - # (to signature: django.db.models.fields.related.ForeignKey(blank=True, null=True, to=orm['auth.User'])) db.alter_column('packages', 'maintainer_id', orm['main.package:maintainer']) - - # Changing field 'Package.pkgname' - # (to signature: django.db.models.fields.CharField(max_length=255, db_index=True)) db.alter_column('packages', 'pkgname', orm['main.package:pkgname']) - - db.create_index('packages', ['pkgname']) def backwards(self, orm): - - # Changing field 'Package.maintainer' - # (to signature: django.db.models.fields.related.ForeignKey(null=True, to=orm['auth.User'])) db.alter_column('packages', 'maintainer_id', orm['main.package:maintainer']) - - # Changing field 'Package.pkgname' - # (to signature: django.db.models.fields.CharField(max_length=255)) db.alter_column('packages', 'pkgname', orm['main.package:pkgname']) - - db.delete_index('packages', ['pkgname']) models = { -- cgit v1.2.3-55-g3dc8