Skip to content

Commit

Permalink
added South for schema migrations and
Browse files Browse the repository at this point in the history
included initial migrations
  • Loading branch information
takinbo committed Jul 7, 2012
1 parent aff5c15 commit f22b450
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -35,7 +35,7 @@ The HTTP Router app replaces most of the functionality provided by these package
Installation From Cheese Shop
=============================

You can install the latest version of the rapidsms-xforms library straight from the cheese shop::
You can install the latest version of the rapidsms-httprouter library straight from the cheese shop::

% pip install rapidsms-httprouter

Expand Down
2 changes: 1 addition & 1 deletion pip-requires.txt
@@ -1,2 +1,2 @@
rapidsms==0.96a

South==0.7.5
60 changes: 60 additions & 0 deletions rapidsms_httprouter/migrations/0001_initial.py
@@ -0,0 +1,60 @@
# -*- coding: 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 'Message'
db.create_table('rapidsms_httprouter_message', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('connection', self.gf('django.db.models.fields.related.ForeignKey')(related_name='messages', to=orm['rapidsms.Connection'])),
('text', self.gf('django.db.models.fields.TextField')()),
('direction', self.gf('django.db.models.fields.CharField')(max_length=1)),
('status', self.gf('django.db.models.fields.CharField')(max_length=1)),
('date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('in_response_to', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='responses', null=True, to=orm['rapidsms_httprouter.Message'])),
))
db.send_create_signal('rapidsms_httprouter', ['Message'])


def backwards(self, orm):
# Deleting model 'Message'
db.delete_table('rapidsms_httprouter_message')


models = {
'rapidsms.backend': {
'Meta': {'object_name': 'Backend'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'})
},
'rapidsms.connection': {
'Meta': {'unique_together': "(('backend', 'identity'),)", 'object_name': 'Connection'},
'backend': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['rapidsms.Backend']"}),
'contact': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['rapidsms.Contact']", 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'identity': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'rapidsms.contact': {
'Meta': {'object_name': 'Contact'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'language': ('django.db.models.fields.CharField', [], {'max_length': '6', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'})
},
'rapidsms_httprouter.message': {
'Meta': {'object_name': 'Message'},
'connection': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'messages'", 'to': "orm['rapidsms.Connection']"}),
'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'direction': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'in_response_to': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'responses'", 'null': 'True', 'to': "orm['rapidsms_httprouter.Message']"}),
'status': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
'text': ('django.db.models.fields.TextField', [], {})
}
}

complete_apps = ['rapidsms_httprouter']
Empty file.

0 comments on commit f22b450

Please sign in to comment.