]> err.no Git - peojumk/commitdiff
Install south, use migrations
authorTollef Fog Heen <tfheen@err.no>
Sat, 5 May 2012 17:19:36 +0000 (19:19 +0200)
committerTollef Fog Heen <tfheen@err.no>
Sat, 5 May 2012 17:19:36 +0000 (19:19 +0200)
invoice/migrations/0001_initial.py [new file with mode: 0644]
invoice/migrations/__init__.py [new file with mode: 0644]
peojumk/settings.py

diff --git a/invoice/migrations/0001_initial.py b/invoice/migrations/0001_initial.py
new file mode 100644 (file)
index 0000000..a96a348
--- /dev/null
@@ -0,0 +1,100 @@
+# 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 'Client'
+        db.create_table('invoice_client', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('name', self.gf('django.db.models.fields.CharField')(max_length=100)),
+            ('email', self.gf('django.db.models.fields.CharField')(max_length=100)),
+            ('address', self.gf('django.db.models.fields.TextField')()),
+        ))
+        db.send_create_signal('invoice', ['Client'])
+
+        # Adding model 'Invoice'
+        db.create_table('invoice_invoice', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('customer', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['invoice.Client'])),
+            ('status', self.gf('django.db.models.fields.CharField')(max_length=1)),
+            ('date', self.gf('django.db.models.fields.DateField')()),
+            ('currency', self.gf('django.db.models.fields.CharField')(max_length=10)),
+        ))
+        db.send_create_signal('invoice', ['Invoice'])
+
+        # Adding model 'VAT'
+        db.create_table('invoice_vat', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('name', self.gf('django.db.models.fields.CharField')(max_length=255)),
+            ('percentage', self.gf('django.db.models.fields.DecimalField')(max_digits=4, decimal_places=2)),
+        ))
+        db.send_create_signal('invoice', ['VAT'])
+
+        # Adding model 'InvoiceLine'
+        db.create_table('invoice_invoiceline', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('invoice', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['invoice.Invoice'])),
+            ('description', self.gf('django.db.models.fields.CharField')(max_length=100)),
+            ('tax', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['invoice.VAT'])),
+            ('time', self.gf('django.db.models.fields.IntegerField')(blank=True)),
+            ('hourly_rate', self.gf('django.db.models.fields.DecimalField')(default=300.0, max_digits=6, decimal_places=2)),
+            ('amount', self.gf('django.db.models.fields.DecimalField')(max_digits=19, decimal_places=2)),
+        ))
+        db.send_create_signal('invoice', ['InvoiceLine'])
+
+
+    def backwards(self, orm):
+        
+        # Deleting model 'Client'
+        db.delete_table('invoice_client')
+
+        # Deleting model 'Invoice'
+        db.delete_table('invoice_invoice')
+
+        # Deleting model 'VAT'
+        db.delete_table('invoice_vat')
+
+        # Deleting model 'InvoiceLine'
+        db.delete_table('invoice_invoiceline')
+
+
+    models = {
+        'invoice.client': {
+            'Meta': {'object_name': 'Client'},
+            'address': ('django.db.models.fields.TextField', [], {}),
+            'email': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+        },
+        'invoice.invoice': {
+            'Meta': {'object_name': 'Invoice'},
+            'currency': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
+            'customer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['invoice.Client']"}),
+            'date': ('django.db.models.fields.DateField', [], {}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'status': ('django.db.models.fields.CharField', [], {'max_length': '1'})
+        },
+        'invoice.invoiceline': {
+            'Meta': {'object_name': 'InvoiceLine'},
+            'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '19', 'decimal_places': '2'}),
+            'description': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+            'hourly_rate': ('django.db.models.fields.DecimalField', [], {'default': '300.0', 'max_digits': '6', 'decimal_places': '2'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'invoice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['invoice.Invoice']"}),
+            'tax': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['invoice.VAT']"}),
+            'time': ('django.db.models.fields.IntegerField', [], {'blank': 'True'})
+        },
+        'invoice.vat': {
+            'Meta': {'object_name': 'VAT'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+            'percentage': ('django.db.models.fields.DecimalField', [], {'max_digits': '4', 'decimal_places': '2'})
+        }
+    }
+
+    complete_apps = ['invoice']
diff --git a/invoice/migrations/__init__.py b/invoice/migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
index 5caaa6154ab91aa96f2d2bee61419a3fa4916f09..db5c415362b43a4a1aa6e3116134420d332f902c 100644 (file)
@@ -124,6 +124,7 @@ INSTALLED_APPS = (
     'django.contrib.admin',
     # Uncomment the next line to enable admin documentation:
     # 'django.contrib.admindocs',
+    'south',
     'invoice',
 )