Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…o ones.
  • Loading branch information...
commit 37373b3edb3ecc1d94be4bd0641647ebf8a6fec1 1 parent c4bb77e
@jacobian jacobian authored
View
47 django_website/aggregator/migrations/0002_rename_tables.py
@@ -0,0 +1,47 @@
+# 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):
+ # rename tables from the hardcoded old names to the Django defaults.
+ db.rename_table('aggregator_feeds', 'aggregator_feed')
+ db.rename_table('aggregator_feeditems', 'aggregator_feeditem')
+
+ def backwards(self, orm):
+ db.rename_table('aggregator_feed', 'aggregator_feeds')
+ db.rename_table('aggregator_feeditem', 'aggregator_feeditems')
+
+ models = {
+ 'aggregator.feed': {
+ 'Meta': {'object_name': 'Feed'},
+ 'feed_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['aggregator.FeedType']"}),
+ 'feed_url': ('django.db.models.fields.URLField', [], {'unique': 'True', 'max_length': '500'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_defunct': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'public_url': ('django.db.models.fields.URLField', [], {'max_length': '500'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '500'})
+ },
+ 'aggregator.feeditem': {
+ 'Meta': {'ordering': "('-date_modified',)", 'object_name': 'FeedItem'},
+ 'date_modified': ('django.db.models.fields.DateTimeField', [], {}),
+ 'feed': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['aggregator.Feed']"}),
+ 'guid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '500', 'db_index': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'link': ('django.db.models.fields.URLField', [], {'max_length': '500'}),
+ 'summary': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '500'})
+ },
+ 'aggregator.feedtype': {
+ 'Meta': {'object_name': 'FeedType'},
+ 'can_self_add': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '250', 'db_index': 'True'})
+ }
+ }
+
+ complete_apps = ['aggregator']
View
4 django_website/aggregator/models.py
@@ -18,9 +18,6 @@ class Feed(models.Model):
is_defunct = models.BooleanField()
feed_type = models.ForeignKey(FeedType)
- class Meta:
- db_table = 'aggregator_feeds'
-
def __unicode__(self):
return self.title
@@ -68,7 +65,6 @@ class FeedItem(models.Model):
objects = FeedItemManager()
class Meta:
- db_table = 'aggregator_feeditems'
ordering = ("-date_modified",)
def __unicode__(self):
Please sign in to comment.
Something went wrong with that request. Please try again.