Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Rename the aggregator tables from their old-ass names to modern Djang…

…o ones.
  • Loading branch information...
commit 37373b3edb3ecc1d94be4bd0641647ebf8a6fec1 1 parent c4bb77e
Jacob Kaplan-Moss authored January 31, 2011
47  django_website/aggregator/migrations/0002_rename_tables.py
... ...
@@ -0,0 +1,47 @@
  1
+# encoding: utf-8
  2
+import datetime
  3
+from south.db import db
  4
+from south.v2 import SchemaMigration
  5
+from django.db import models
  6
+
  7
+class Migration(SchemaMigration):
  8
+
  9
+    def forwards(self, orm):
  10
+        # rename tables from the hardcoded old names to the Django defaults.
  11
+        db.rename_table('aggregator_feeds', 'aggregator_feed')
  12
+        db.rename_table('aggregator_feeditems', 'aggregator_feeditem')
  13
+
  14
+    def backwards(self, orm):
  15
+        db.rename_table('aggregator_feed', 'aggregator_feeds')
  16
+        db.rename_table('aggregator_feeditem', 'aggregator_feeditems')
  17
+
  18
+    models = {
  19
+        'aggregator.feed': {
  20
+            'Meta': {'object_name': 'Feed'},
  21
+            'feed_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['aggregator.FeedType']"}),
  22
+            'feed_url': ('django.db.models.fields.URLField', [], {'unique': 'True', 'max_length': '500'}),
  23
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  24
+            'is_defunct': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  25
+            'public_url': ('django.db.models.fields.URLField', [], {'max_length': '500'}),
  26
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '500'})
  27
+        },
  28
+        'aggregator.feeditem': {
  29
+            'Meta': {'ordering': "('-date_modified',)", 'object_name': 'FeedItem'},
  30
+            'date_modified': ('django.db.models.fields.DateTimeField', [], {}),
  31
+            'feed': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['aggregator.Feed']"}),
  32
+            'guid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '500', 'db_index': 'True'}),
  33
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  34
+            'link': ('django.db.models.fields.URLField', [], {'max_length': '500'}),
  35
+            'summary': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
  36
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '500'})
  37
+        },
  38
+        'aggregator.feedtype': {
  39
+            'Meta': {'object_name': 'FeedType'},
  40
+            'can_self_add': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
  41
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  42
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
  43
+            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '250', 'db_index': 'True'})
  44
+        }
  45
+    }
  46
+
  47
+    complete_apps = ['aggregator']
4  django_website/aggregator/models.py
@@ -18,9 +18,6 @@ class Feed(models.Model):
18 18
     is_defunct = models.BooleanField()
19 19
     feed_type = models.ForeignKey(FeedType)
20 20
 
21  
-    class Meta:
22  
-        db_table = 'aggregator_feeds'
23  
-
24 21
     def __unicode__(self):
25 22
         return self.title
26 23
 
@@ -68,7 +65,6 @@ class FeedItem(models.Model):
68 65
     objects = FeedItemManager()
69 66
 
70 67
     class Meta:
71  
-        db_table = 'aggregator_feeditems'
72 68
         ordering = ("-date_modified",)
73 69
 
74 70
     def __unicode__(self):

0 notes on commit 37373b3

Please sign in to comment.
Something went wrong with that request. Please try again.