Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame^] | 1 | # -*- coding: utf-8 -*- |
| 2 | from south.utils import datetime_utils as datetime |
| 3 | from south.db import db |
| 4 | from south.v2 import DataMigration |
| 5 | from django.db import models |
| 6 | |
| 7 | class Migration(DataMigration): |
| 8 | |
| 9 | def forwards(self, orm): |
| 10 | "Write your forwards methods here." |
| 11 | # Note: Don't use "from appname.models import ModelName". |
| 12 | # Use orm.ModelName to refer to models in this application, |
| 13 | # and orm['appname.ModelName'] for models in other applications. |
| 14 | try: |
| 15 | orm.BuildEnvironment.objects.get(pk = 1) |
| 16 | except: |
| 17 | from django.utils import timezone |
| 18 | orm.BuildEnvironment.objects.create(pk = 1, |
| 19 | created = timezone.now(), |
| 20 | updated = timezone.now(), |
| 21 | betype = 0) |
| 22 | |
| 23 | def backwards(self, orm): |
| 24 | "Write your backwards methods here." |
| 25 | |
| 26 | models = { |
| 27 | u'bldcontrol.brlayer': { |
| 28 | 'Meta': {'object_name': 'BRLayer'}, |
| 29 | 'commit': ('django.db.models.fields.CharField', [], {'max_length': '254'}), |
| 30 | 'dirpath': ('django.db.models.fields.CharField', [], {'max_length': '254'}), |
| 31 | 'giturl': ('django.db.models.fields.CharField', [], {'max_length': '254'}), |
| 32 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
| 33 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
| 34 | 'req': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['bldcontrol.BuildRequest']"}) |
| 35 | }, |
| 36 | u'bldcontrol.brtarget': { |
| 37 | 'Meta': {'object_name': 'BRTarget'}, |
| 38 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
| 39 | 'req': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['bldcontrol.BuildRequest']"}), |
| 40 | 'target': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
| 41 | 'task': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}) |
| 42 | }, |
| 43 | u'bldcontrol.brvariable': { |
| 44 | 'Meta': {'object_name': 'BRVariable'}, |
| 45 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
| 46 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
| 47 | 'req': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['bldcontrol.BuildRequest']"}), |
| 48 | 'value': ('django.db.models.fields.TextField', [], {'blank': 'True'}) |
| 49 | }, |
| 50 | u'bldcontrol.buildenvironment': { |
| 51 | 'Meta': {'object_name': 'BuildEnvironment'}, |
| 52 | 'address': ('django.db.models.fields.CharField', [], {'max_length': '254'}), |
| 53 | 'bbaddress': ('django.db.models.fields.CharField', [], {'max_length': '254', 'blank': 'True'}), |
| 54 | 'bbport': ('django.db.models.fields.IntegerField', [], {'default': '-1'}), |
| 55 | 'bbstate': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
| 56 | 'bbtoken': ('django.db.models.fields.CharField', [], {'max_length': '126', 'blank': 'True'}), |
| 57 | 'betype': ('django.db.models.fields.IntegerField', [], {}), |
| 58 | 'builddir': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), |
| 59 | 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), |
| 60 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
| 61 | 'lock': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
| 62 | 'sourcedir': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}), |
| 63 | 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) |
| 64 | }, |
| 65 | u'bldcontrol.buildrequest': { |
| 66 | 'Meta': {'object_name': 'BuildRequest'}, |
| 67 | 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']", 'null': 'True'}), |
| 68 | 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), |
| 69 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
| 70 | 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Project']"}), |
| 71 | 'state': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
| 72 | 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) |
| 73 | }, |
| 74 | u'orm.build': { |
| 75 | 'Meta': {'object_name': 'Build'}, |
| 76 | 'bitbake_version': ('django.db.models.fields.CharField', [], {'max_length': '50'}), |
| 77 | 'build_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
| 78 | 'completed_on': ('django.db.models.fields.DateTimeField', [], {}), |
| 79 | 'cooker_log_path': ('django.db.models.fields.CharField', [], {'max_length': '500'}), |
| 80 | 'distro': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
| 81 | 'distro_version': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
| 82 | 'errors_no': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
| 83 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
| 84 | 'machine': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
| 85 | 'outcome': ('django.db.models.fields.IntegerField', [], {'default': '2'}), |
| 86 | 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Project']", 'null': 'True'}), |
| 87 | 'started_on': ('django.db.models.fields.DateTimeField', [], {}), |
| 88 | 'timespent': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
| 89 | 'warnings_no': ('django.db.models.fields.IntegerField', [], {'default': '0'}) |
| 90 | }, |
| 91 | u'orm.project': { |
| 92 | 'Meta': {'object_name': 'Project'}, |
| 93 | 'branch': ('django.db.models.fields.CharField', [], {'max_length': '50'}), |
| 94 | 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), |
| 95 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
| 96 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
| 97 | 'short_description': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), |
| 98 | 'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), |
| 99 | 'user_id': ('django.db.models.fields.IntegerField', [], {'null': 'True'}) |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | complete_apps = ['bldcontrol'] |
| 104 | symmetrical = True |