0001_001.py 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # -*- coding: utf-8 -*-
  2. import datetime
  3. from south.db import db
  4. from south.v2 import SchemaMigration
  5. from django.db import models
  6. class Migration(SchemaMigration):
  7. def forwards(self, orm):
  8. # Adding model 'Invoice'
  9. db.create_table(u'billing_invoice', (
  10. (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
  11. ('status', self.gf('django.db.models.fields.CharField')(default='open', max_length=50)),
  12. ('amount', self.gf('django.db.models.fields.DecimalField')(max_digits=5, decimal_places=2)),
  13. ('date', self.gf('django.db.models.fields.DateField')(auto_now_add=True, null=True, blank=True)),
  14. ('period_from', self.gf('django.db.models.fields.DateField')(null=True)),
  15. ('period_to', self.gf('django.db.models.fields.DateField')(null=True)),
  16. ('date_due', self.gf('django.db.models.fields.DateField')(null=True)),
  17. ))
  18. db.send_create_signal(u'billing', ['Invoice'])
  19. # Adding model 'InvoiceDetail'
  20. db.create_table(u'billing_invoicedetail', (
  21. (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
  22. ('label', self.gf('django.db.models.fields.CharField')(max_length=100)),
  23. ('amount', self.gf('django.db.models.fields.DecimalField')(max_digits=5, decimal_places=2)),
  24. ('quantity', self.gf('django.db.models.fields.IntegerField')(null=True)),
  25. ('tax', self.gf('django.db.models.fields.IntegerField')(null=True)),
  26. ('invoice', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['billing.Invoice'])),
  27. ))
  28. db.send_create_signal(u'billing', ['InvoiceDetail'])
  29. # Adding model 'Payment'
  30. db.create_table(u'billing_payment', (
  31. (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
  32. ('payment_means', self.gf('django.db.models.fields.CharField')(max_length=100, null=True)),
  33. ('amount', self.gf('django.db.models.fields.DecimalField')(null=True, max_digits=7, decimal_places=2)),
  34. ('date', self.gf('django.db.models.fields.DateField')(auto_now_add=True, blank=True)),
  35. ('invoce', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['billing.Invoice'])),
  36. ))
  37. db.send_create_signal(u'billing', ['Payment'])
  38. def backwards(self, orm):
  39. # Deleting model 'Invoice'
  40. db.delete_table(u'billing_invoice')
  41. # Deleting model 'InvoiceDetail'
  42. db.delete_table(u'billing_invoicedetail')
  43. # Deleting model 'Payment'
  44. db.delete_table(u'billing_payment')
  45. models = {
  46. u'billing.invoice': {
  47. 'Meta': {'object_name': 'Invoice'},
  48. 'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '5', 'decimal_places': '2'}),
  49. 'date': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
  50. 'date_due': ('django.db.models.fields.DateField', [], {'null': 'True'}),
  51. u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  52. 'period_from': ('django.db.models.fields.DateField', [], {'null': 'True'}),
  53. 'period_to': ('django.db.models.fields.DateField', [], {'null': 'True'}),
  54. 'status': ('django.db.models.fields.CharField', [], {'default': "'open'", 'max_length': '50'})
  55. },
  56. u'billing.invoicedetail': {
  57. 'Meta': {'object_name': 'InvoiceDetail'},
  58. 'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '5', 'decimal_places': '2'}),
  59. u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  60. 'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['billing.Invoice']"}),
  61. 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  62. 'quantity': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
  63. 'tax': ('django.db.models.fields.IntegerField', [], {'null': 'True'})
  64. },
  65. u'billing.payment': {
  66. 'Meta': {'object_name': 'Payment'},
  67. 'amount': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '7', 'decimal_places': '2'}),
  68. 'date': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
  69. u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  70. 'invoce': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['billing.Invoice']"}),
  71. 'payment_means': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'})
  72. }
  73. }
  74. complete_apps = ['billing']