Skip to content

Commit

Permalink
add migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Rauscher authored and Patrick Rauscher committed Sep 30, 2013
1 parent 4738dbd commit d0e813f
Show file tree
Hide file tree
Showing 13 changed files with 627 additions and 0 deletions.
100 changes: 100 additions & 0 deletions accounting/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# -*- 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 'Journal'
db.create_table(u'accounting_journal', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('label', self.gf('django.db.models.fields.CharField')(max_length=30)),
('allowNull', self.gf('django.db.models.fields.BooleanField')(default=False)),
))
db.send_create_signal(u'accounting', ['Journal'])

# Adding M2M table for field rootAccounts on 'Journal'
m2m_table_name = db.shorten_name(u'accounting_journal_rootAccounts')
db.create_table(m2m_table_name, (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('journal', models.ForeignKey(orm[u'accounting.journal'], null=False)),
('account', models.ForeignKey(orm[u'accounting.account'], null=False))
))
db.create_unique(m2m_table_name, ['journal_id', 'account_id'])

# Adding model 'Account'
db.create_table(u'accounting_account', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('parent', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting.Account'], null=True, blank=True)),
('code', self.gf('django.db.models.fields.CharField')(max_length=10)),
('name', self.gf('django.db.models.fields.CharField')(max_length=50)),
))
db.send_create_signal(u'accounting', ['Account'])

# Adding model 'Record'
db.create_table(u'accounting_record', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
))
db.send_create_signal(u'accounting', ['Record'])

# Adding model 'Split'
db.create_table(u'accounting_split', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('record', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting.Record'])),
('account', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting.Account'])),
('note', self.gf('django.db.models.fields.CharField')(max_length=50)),
('value', self.gf('django.db.models.fields.IntegerField')()),
))
db.send_create_signal(u'accounting', ['Split'])


def backwards(self, orm):
# Deleting model 'Journal'
db.delete_table(u'accounting_journal')

# Removing M2M table for field rootAccounts on 'Journal'
db.delete_table(db.shorten_name(u'accounting_journal_rootAccounts'))

# Deleting model 'Account'
db.delete_table(u'accounting_account')

# Deleting model 'Record'
db.delete_table(u'accounting_record')

# Deleting model 'Split'
db.delete_table(u'accounting_split')


models = {
u'accounting.account': {
'Meta': {'object_name': 'Account'},
'code': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting.Account']", 'null': 'True', 'blank': 'True'})
},
u'accounting.journal': {
'Meta': {'object_name': 'Journal'},
'allowNull': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
'rootAccounts': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['accounting.Account']", 'symmetrical': 'False'})
},
u'accounting.record': {
'Meta': {'object_name': 'Record'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
u'accounting.split': {
'Meta': {'object_name': 'Split'},
'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting.Account']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'note': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
'record': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting.Record']"}),
'value': ('django.db.models.fields.IntegerField', [], {})
}
}

complete_apps = ['accounting']
Empty file.
160 changes: 160 additions & 0 deletions crm/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# -*- 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 'Entity'
db.create_table(u'crm_entity', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('memo', self.gf('django.db.models.fields.TextField')(blank=True)),
))
db.send_create_signal(u'crm', ['Entity'])

# Adding M2M table for field links on 'Entity'
m2m_table_name = db.shorten_name(u'crm_entity_links')
db.create_table(m2m_table_name, (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('from_entity', models.ForeignKey(orm[u'crm.entity'], null=False)),
('to_entity', models.ForeignKey(orm[u'crm.entity'], null=False))
))
db.create_unique(m2m_table_name, ['from_entity_id', 'to_entity_id'])

# Adding M2M table for field tags on 'Entity'
m2m_table_name = db.shorten_name(u'crm_entity_tags')
db.create_table(m2m_table_name, (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('entity', models.ForeignKey(orm[u'crm.entity'], null=False)),
('tag', models.ForeignKey(orm[u'crm.tag'], null=False))
))
db.create_unique(m2m_table_name, ['entity_id', 'tag_id'])

# Adding model 'Tag'
db.create_table(u'crm_tag', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('label', self.gf('django.db.models.fields.CharField')(max_length=30)),
))
db.send_create_signal(u'crm', ['Tag'])

# Adding model 'Process'
db.create_table(u'crm_process', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('start', self.gf('django.db.models.fields.DateTimeField')()),
('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
))
db.send_create_signal(u'crm', ['Process'])

# Adding model 'Filter'
db.create_table(u'crm_filter', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('name', self.gf('django.db.models.fields.CharField')(max_length=70)),
))
db.send_create_signal(u'crm', ['Filter'])

# Adding model 'Invariant'
db.create_table(u'crm_invariant', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('filter', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['crm.Filter'])),
('name', self.gf('django.db.models.fields.CharField')(max_length=50)),
('description', self.gf('django.db.models.fields.TextField')()),
))
db.send_create_signal(u'crm', ['Invariant'])


def backwards(self, orm):
# Deleting model 'Entity'
db.delete_table(u'crm_entity')

# Removing M2M table for field links on 'Entity'
db.delete_table(db.shorten_name(u'crm_entity_links'))

# Removing M2M table for field tags on 'Entity'
db.delete_table(db.shorten_name(u'crm_entity_tags'))

# Deleting model 'Tag'
db.delete_table(u'crm_tag')

# Deleting model 'Process'
db.delete_table(u'crm_process')

# Deleting model 'Filter'
db.delete_table(u'crm_filter')

# Deleting model 'Invariant'
db.delete_table(u'crm_invariant')


models = {
u'auth.group': {
'Meta': {'object_name': 'Group'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
u'auth.permission': {
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
u'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'}),
u'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'})
},
u'crm.entity': {
'Meta': {'object_name': 'Entity'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'links': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'links_rel_+'", 'blank': 'True', 'to': u"orm['crm.Entity']"}),
'memo': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['crm.Tag']", 'symmetrical': 'False', 'blank': 'True'})
},
u'crm.filter': {
'Meta': {'object_name': 'Filter'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '70'})
},
u'crm.invariant': {
'Meta': {'object_name': 'Invariant'},
'description': ('django.db.models.fields.TextField', [], {}),
'filter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['crm.Filter']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'crm.process': {
'Meta': {'object_name': 'Process'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'start': ('django.db.models.fields.DateTimeField', [], {}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"})
},
u'crm.tag': {
'Meta': {'object_name': 'Tag'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'label': ('django.db.models.fields.CharField', [], {'max_length': '30'})
}
}

complete_apps = ['crm']
Empty file added crm/migrations/__init__.py
Empty file.
86 changes: 86 additions & 0 deletions crm_accounting/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# -*- 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 'Affiliate'
db.create_table(u'crm_accounting_affiliate', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('contact', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['crm_contacts.Contact'])),
('account', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounting.Account'])),
))
db.send_create_signal(u'crm_accounting', ['Affiliate'])

# Adding model 'AffiliateAccount'
db.create_table(u'crm_accounting_affiliateaccount', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('affiliate', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['crm_accounting.Affiliate'])),
('iban', self.gf('django.db.models.fields.CharField')(max_length=34)),
))
db.send_create_signal(u'crm_accounting', ['AffiliateAccount'])


def backwards(self, orm):
# Deleting model 'Affiliate'
db.delete_table(u'crm_accounting_affiliate')

# Deleting model 'AffiliateAccount'
db.delete_table(u'crm_accounting_affiliateaccount')


models = {
u'accounting.account': {
'Meta': {'object_name': 'Account'},
'code': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting.Account']", 'null': 'True', 'blank': 'True'})
},
u'crm.entity': {
'Meta': {'object_name': 'Entity'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'links': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'links_rel_+'", 'blank': 'True', 'to': u"orm['crm.Entity']"}),
'memo': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['crm.Tag']", 'symmetrical': 'False', 'blank': 'True'})
},
u'crm.tag': {
'Meta': {'object_name': 'Tag'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'label': ('django.db.models.fields.CharField', [], {'max_length': '30'})
},
u'crm_accounting.affiliate': {
'Meta': {'object_name': 'Affiliate'},
'account': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['accounting.Account']"}),
'contact': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['crm_contacts.Contact']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
u'crm_accounting.affiliateaccount': {
'Meta': {'object_name': 'AffiliateAccount'},
'affiliate': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['crm_accounting.Affiliate']"}),
'iban': ('django.db.models.fields.CharField', [], {'max_length': '34'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
u'crm_contacts.contact': {
'Meta': {'object_name': 'Contact', '_ormbases': [u'crm.Entity']},
'emails': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['crm_contacts.Email']", 'symmetrical': 'False'}),
u'entity_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['crm.Entity']", 'unique': 'True', 'primary_key': 'True'}),
'telephoneNumbers': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['crm_contacts.TelephoneNumber']", 'symmetrical': 'False', 'blank': 'True'})
},
u'crm_contacts.email': {
'Meta': {'object_name': 'Email'},
'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '75'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
u'crm_contacts.telephonenumber': {
'Meta': {'object_name': 'TelephoneNumber'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'telephone': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'})
}
}

complete_apps = ['crm_accounting']
Empty file.
Loading

0 comments on commit d0e813f

Please sign in to comment.