summaryrefslogtreecommitdiff
path: root/main/migrations
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-04-26 11:55:18 -0500
committerDan McGee <dan@archlinux.org>2012-04-26 11:55:18 -0500
commite35ad5dd8e3e776d39a13d1f6cd18c3fa4d49b27 (patch)
treea41390087e855d4ee4183b1b5445a31b073626af /main/migrations
parent7f2ed459e92b56c28a8ca50292e95a42987544d4 (diff)
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 <dan@archlinux.org>
Diffstat (limited to 'main/migrations')
-rw-r--r--main/migrations/0004_add_pkgname_index.py22
1 files 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 = {