Source

django-pim / pcbank / migrations / 0001_initial.py

# -*- 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 'Transaction'
        db.create_table('pcbank_transaction', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('from_ct', self.gf('django.db.models.fields.related.ForeignKey')(related_name='fromtrans_set', to=orm['contenttypes.ContentType'])),
            ('from_id', self.gf('django.db.models.fields.PositiveIntegerField')()),
            ('amount', self.gf('django.db.models.fields.DecimalField')(max_digits=6, decimal_places=2)),
            ('memo', self.gf('django.db.models.fields.CharField')(max_length=60, null=True, blank=True)),
            ('date', self.gf('django.db.models.fields.DateField')(auto_now_add=True, blank=True)),
            ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])),
            ('object_id', self.gf('django.db.models.fields.PositiveIntegerField')()),
        ))
        db.send_create_signal('pcbank', ['Transaction'])

        # Adding model 'Income'
        db.create_table('pcbank_income', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('title', self.gf('django.db.models.fields.CharField')(max_length=80)),
            ('amount', self.gf('django.db.models.fields.DecimalField')(max_digits=6, decimal_places=2)),
            ('per_month', self.gf('django.db.models.fields.IntegerField')()),
            ('active', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('added_on', self.gf('django.db.models.fields.DateField')(auto_now_add=True, blank=True)),
        ))
        db.send_create_signal('pcbank', ['Income'])

        # Adding model 'CreditCard'
        db.create_table('pcbank_creditcard', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('title', self.gf('django.db.models.fields.CharField')(max_length=80)),
            ('credit', self.gf('django.db.models.fields.DecimalField')(max_digits=6, decimal_places=2)),
            ('balance', self.gf('django.db.models.fields.DecimalField')(max_digits=6, decimal_places=2)),
            ('min_payment', self.gf('django.db.models.fields.DecimalField')(max_digits=6, decimal_places=2)),
            ('due_date', self.gf('django.db.models.fields.DateField')()),
            ('active', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('added_on', self.gf('django.db.models.fields.DateField')(auto_now_add=True, blank=True)),
            ('url', self.gf('django.db.models.fields.URLField')(max_length=200)),
        ))
        db.send_create_signal('pcbank', ['CreditCard'])

        # Adding model 'Payee'
        db.create_table('pcbank_payee', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('title', self.gf('django.db.models.fields.CharField')(max_length=80)),
            ('account', self.gf('django.db.models.fields.CharField')(max_length=40)),
            ('split_by', self.gf('django.db.models.fields.IntegerField')()),
            ('due_date', self.gf('django.db.models.fields.DateField')()),
            ('active', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('added_on', self.gf('django.db.models.fields.DateField')(auto_now_add=True, blank=True)),
        ))
        db.send_create_signal('pcbank', ['Payee'])

        # Adding model 'Bill'
        db.create_table('pcbank_bill', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('payee', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['pcbank.Payee'])),
            ('amount', self.gf('django.db.models.fields.DecimalField')(max_digits=5, decimal_places=2)),
            ('added_on', self.gf('django.db.models.fields.DateField')(auto_now_add=True, blank=True)),
            ('paid', self.gf('django.db.models.fields.BooleanField')(default=False)),
        ))
        db.send_create_signal('pcbank', ['Bill'])

        # Adding model 'Bank'
        db.create_table('pcbank_bank', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('title', self.gf('django.db.models.fields.CharField')(max_length=80)),
            ('card', self.gf('django.db.models.fields.CharField')(max_length=40)),
            ('balance', self.gf('django.db.models.fields.DecimalField')(max_digits=6, decimal_places=2)),
            ('added_on', self.gf('django.db.models.fields.DateField')(auto_now_add=True, blank=True)),
            ('active', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('url', self.gf('django.db.models.fields.URLField')(max_length=200)),
        ))
        db.send_create_signal('pcbank', ['Bank'])

        # Adding model 'Roommate'
        db.create_table('pcbank_roommate', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=20)),
            ('total_given', self.gf('django.db.models.fields.DecimalField')(max_digits=6, decimal_places=2)),
            ('added_on', self.gf('django.db.models.fields.DateField')(auto_now_add=True, blank=True)),
            ('active', self.gf('django.db.models.fields.BooleanField')(default=False)),
        ))
        db.send_create_signal('pcbank', ['Roommate'])

        # Adding model 'RoommateBill'
        db.create_table('pcbank_roommatebill', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('roommate', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['pcbank.Roommate'])),
            ('for_bill', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['pcbank.Bill'])),
            ('paid', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('pay_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)),
        ))
        db.send_create_signal('pcbank', ['RoommateBill'])


    def backwards(self, orm):
        # Deleting model 'Transaction'
        db.delete_table('pcbank_transaction')

        # Deleting model 'Income'
        db.delete_table('pcbank_income')

        # Deleting model 'CreditCard'
        db.delete_table('pcbank_creditcard')

        # Deleting model 'Payee'
        db.delete_table('pcbank_payee')

        # Deleting model 'Bill'
        db.delete_table('pcbank_bill')

        # Deleting model 'Bank'
        db.delete_table('pcbank_bank')

        # Deleting model 'Roommate'
        db.delete_table('pcbank_roommate')

        # Deleting model 'RoommateBill'
        db.delete_table('pcbank_roommatebill')


    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'})
        },
        'pcbank.bank': {
            'Meta': {'object_name': 'Bank'},
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'added_on': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'balance': ('django.db.models.fields.DecimalField', [], {'max_digits': '6', 'decimal_places': '2'}),
            'card': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
            'url': ('django.db.models.fields.URLField', [], {'max_length': '200'})
        },
        'pcbank.bill': {
            'Meta': {'object_name': 'Bill'},
            'added_on': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '5', 'decimal_places': '2'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'paid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'payee': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['pcbank.Payee']"})
        },
        'pcbank.creditcard': {
            'Meta': {'object_name': 'CreditCard'},
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'added_on': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'balance': ('django.db.models.fields.DecimalField', [], {'max_digits': '6', 'decimal_places': '2'}),
            'credit': ('django.db.models.fields.DecimalField', [], {'max_digits': '6', 'decimal_places': '2'}),
            'due_date': ('django.db.models.fields.DateField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'min_payment': ('django.db.models.fields.DecimalField', [], {'max_digits': '6', 'decimal_places': '2'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
            'url': ('django.db.models.fields.URLField', [], {'max_length': '200'})
        },
        'pcbank.income': {
            'Meta': {'object_name': 'Income'},
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'added_on': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '6', 'decimal_places': '2'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'per_month': ('django.db.models.fields.IntegerField', [], {}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '80'})
        },
        'pcbank.payee': {
            'Meta': {'ordering': "['due_date']", 'object_name': 'Payee'},
            'account': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'added_on': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'due_date': ('django.db.models.fields.DateField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'split_by': ('django.db.models.fields.IntegerField', [], {}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '80'})
        },
        'pcbank.roommate': {
            'Meta': {'object_name': 'Roommate'},
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'added_on': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
            'total_given': ('django.db.models.fields.DecimalField', [], {'max_digits': '6', 'decimal_places': '2'})
        },
        'pcbank.roommatebill': {
            'Meta': {'object_name': 'RoommateBill'},
            'for_bill': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['pcbank.Bill']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'paid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'pay_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
            'roommate': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['pcbank.Roommate']"})
        },
        'pcbank.transaction': {
            'Meta': {'ordering': "['-date']", 'object_name': 'Transaction'},
            'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '6', 'decimal_places': '2'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'date': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'from_ct': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fromtrans_set'", 'to': "orm['contenttypes.ContentType']"}),
            'from_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'memo': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True', 'blank': 'True'}),
            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {})
        }
    }

    complete_apps = ['pcbank']