This repository has been archived by the owner on Aug 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 679
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert django-taggit to be covered by South migrations
- Loading branch information
Showing
6 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- | ||
-- Taggit app converted to use South, simulate --fake to skip first migration | ||
-- | ||
INSERT INTO `south_migrationhistory` VALUES (null,'taggit','0001_initial','2011-05-27 10:00:00'); |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# 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): | ||
|
||
# Adding model 'Tag' | ||
db.create_table('taggit_tag', ( | ||
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), | ||
('name', self.gf('django.db.models.fields.CharField')(max_length=100)), | ||
('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=100, db_index=True)), | ||
)) | ||
db.send_create_signal('taggit', ['Tag']) | ||
|
||
# Adding model 'TaggedItem' | ||
db.create_table('taggit_taggeditem', ( | ||
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), | ||
('tag', self.gf('django.db.models.fields.related.ForeignKey')(related_name='taggit_taggeditem_items', to=orm['taggit.Tag'])), | ||
('object_id', self.gf('django.db.models.fields.IntegerField')()), | ||
('content_type', self.gf('django.db.models.fields.related.ForeignKey')(related_name='tagged_items', to=orm['contenttypes.ContentType'])), | ||
)) | ||
db.send_create_signal('taggit', ['TaggedItem']) | ||
|
||
|
||
def backwards(self, orm): | ||
|
||
# Deleting model 'Tag' | ||
db.delete_table('taggit_tag') | ||
|
||
# Deleting model 'TaggedItem' | ||
db.delete_table('taggit_taggeditem') | ||
|
||
|
||
models = { | ||
'contenttypes.contenttype': { | ||
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, | ||
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) | ||
}, | ||
'taggit.tag': { | ||
'Meta': {'object_name': 'Tag'}, | ||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100', 'db_index': 'True'}) | ||
}, | ||
'taggit.taggeditem': { | ||
'Meta': {'object_name': 'TaggedItem'}, | ||
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tagged_items'", 'to': "orm['contenttypes.ContentType']"}), | ||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'object_id': ('django.db.models.fields.IntegerField', [], {}), | ||
'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'taggit_taggeditem_items'", 'to': "orm['taggit.Tag']"}) | ||
} | ||
} | ||
|
||
complete_apps = ['taggit'] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters