summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-03-06 18:22:38 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-11 12:24:30 -0700
commit7a0add74d910ca98d27c31cd96cd5cd2b1cd9e21 (patch)
tree0a51a175c78a941e2bedee6b2fc613855a97517e /bitbake
parent5f05bdda0bf3f9fadf287a0632c2fa697380273f (diff)
downloadpoky-7a0add74d910ca98d27c31cd96cd5cd2b1cd9e21.tar.gz
bitbake: toaster: update database schema
This is a schema update to account for * relaxing constraints in Target_Image_File table * modifying permission filed to string value * adding license_manifest_path field * adding image_size field (Bitbake rev: f8488845ee9670e16a63c331dd2e97fdb314929c) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/orm/migrations/0006_auto__add_field_target_image_size__add_field_target_license_manifest_p.py235
-rw-r--r--bitbake/lib/toaster/orm/models.py11
2 files changed, 241 insertions, 5 deletions
diff --git a/bitbake/lib/toaster/orm/migrations/0006_auto__add_field_target_image_size__add_field_target_license_manifest_p.py b/bitbake/lib/toaster/orm/migrations/0006_auto__add_field_target_image_size__add_field_target_license_manifest_p.py
new file mode 100644
index 0000000000..8195d0907d
--- /dev/null
+++ b/bitbake/lib/toaster/orm/migrations/0006_auto__add_field_target_image_size__add_field_target_license_manifest_p.py
@@ -0,0 +1,235 @@
1# -*- coding: utf-8 -*-
2from south.utils import datetime_utils as datetime
3from south.db import db
4from south.v2 import SchemaMigration
5from django.db import models
6
7
8class Migration(SchemaMigration):
9
10 def forwards(self, orm):
11 # Adding field 'Target.image_size'
12 db.add_column(u'orm_target', 'image_size',
13 self.gf('django.db.models.fields.IntegerField')(default=0),
14 keep_default=False)
15
16 # Adding field 'Target.license_manifest_path'
17 db.add_column(u'orm_target', 'license_manifest_path',
18 self.gf('django.db.models.fields.CharField')(max_length=500, null=True),
19 keep_default=False)
20
21
22 # Changing field 'Target_File.permission'
23 db.alter_column(u'orm_target_file', 'permission', self.gf('django.db.models.fields.CharField')(max_length=16))
24
25 # Changing field 'Target_File.sym_target'
26 db.alter_column(u'orm_target_file', 'sym_target_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['orm.Target_File']))
27
28 # Changing field 'Target_File.directory'
29 db.alter_column(u'orm_target_file', 'directory_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['orm.Target_File']))
30
31 def backwards(self, orm):
32 # Deleting field 'Target.image_size'
33 db.delete_column(u'orm_target', 'image_size')
34
35 # Deleting field 'Target.license_manifest_path'
36 db.delete_column(u'orm_target', 'license_manifest_path')
37
38
39 # Changing field 'Target_File.permission'
40 db.alter_column(u'orm_target_file', 'permission', self.gf('django.db.models.fields.IntegerField')())
41
42 # User chose to not deal with backwards NULL issues for 'Target_File.sym_target'
43 raise RuntimeError("Cannot reverse this migration. 'Target_File.sym_target' and its values cannot be restored.")
44
45 # The following code is provided here to aid in writing a correct migration
46 # Changing field 'Target_File.sym_target'
47 db.alter_column(u'orm_target_file', 'sym_target_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['orm.Target_File']))
48
49 # User chose to not deal with backwards NULL issues for 'Target_File.directory'
50 raise RuntimeError("Cannot reverse this migration. 'Target_File.directory' and its values cannot be restored.")
51
52 # The following code is provided here to aid in writing a correct migration
53 # Changing field 'Target_File.directory'
54 db.alter_column(u'orm_target_file', 'directory_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['orm.Target_File']))
55
56 models = {
57 u'orm.build': {
58 'Meta': {'object_name': 'Build'},
59 'bitbake_version': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
60 'build_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
61 'completed_on': ('django.db.models.fields.DateTimeField', [], {}),
62 'cooker_log_path': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
63 'distro': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
64 'distro_version': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
65 'errors_no': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
66 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
67 'machine': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
68 'outcome': ('django.db.models.fields.IntegerField', [], {'default': '2'}),
69 'started_on': ('django.db.models.fields.DateTimeField', [], {}),
70 'timespent': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
71 'warnings_no': ('django.db.models.fields.IntegerField', [], {'default': '0'})
72 },
73 u'orm.layer': {
74 'Meta': {'object_name': 'Layer'},
75 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
76 'layer_index_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
77 'local_path': ('django.db.models.fields.FilePathField', [], {'max_length': '255'}),
78 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
79 },
80 u'orm.layer_version': {
81 'Meta': {'object_name': 'Layer_Version'},
82 'branch': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
83 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'layer_version_build'", 'to': u"orm['orm.Build']"}),
84 'commit': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
85 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
86 'layer': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'layer_version_layer'", 'to': u"orm['orm.Layer']"}),
87 'priority': ('django.db.models.fields.IntegerField', [], {})
88 },
89 u'orm.logmessage': {
90 'Meta': {'object_name': 'LogMessage'},
91 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}),
92 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
93 'level': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
94 'lineno': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
95 'message': ('django.db.models.fields.CharField', [], {'max_length': '240'}),
96 'pathname': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}),
97 'task': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Task']", 'null': 'True', 'blank': 'True'})
98 },
99 u'orm.package': {
100 'Meta': {'object_name': 'Package'},
101 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}),
102 'description': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
103 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
104 'installed_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'}),
105 'installed_size': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
106 'license': ('django.db.models.fields.CharField', [], {'max_length': '80', 'blank': 'True'}),
107 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
108 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Recipe']", 'null': 'True'}),
109 'revision': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}),
110 'section': ('django.db.models.fields.CharField', [], {'max_length': '80', 'blank': 'True'}),
111 'size': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
112 'summary': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
113 'version': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'})
114 },
115 u'orm.package_dependency': {
116 'Meta': {'object_name': 'Package_Dependency'},
117 'dep_type': ('django.db.models.fields.IntegerField', [], {}),
118 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'package_dependencies_target'", 'to': u"orm['orm.Package']"}),
119 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
120 'package': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'package_dependencies_source'", 'to': u"orm['orm.Package']"}),
121 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']", 'null': 'True'})
122 },
123 u'orm.package_file': {
124 'Meta': {'object_name': 'Package_File'},
125 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
126 'package': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'buildfilelist_package'", 'to': u"orm['orm.Package']"}),
127 'path': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}),
128 'size': ('django.db.models.fields.IntegerField', [], {})
129 },
130 u'orm.recipe': {
131 'Meta': {'object_name': 'Recipe'},
132 'bugtracker': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
133 'description': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
134 'file_path': ('django.db.models.fields.FilePathField', [], {'max_length': '255'}),
135 'homepage': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
136 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
137 'layer_version': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'recipe_layer_version'", 'to': u"orm['orm.Layer_Version']"}),
138 'license': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
139 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
140 'section': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
141 'summary': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
142 'version': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'})
143 },
144 u'orm.recipe_dependency': {
145 'Meta': {'object_name': 'Recipe_Dependency'},
146 'dep_type': ('django.db.models.fields.IntegerField', [], {}),
147 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'r_dependencies_depends'", 'to': u"orm['orm.Recipe']"}),
148 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
149 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'r_dependencies_recipe'", 'to': u"orm['orm.Recipe']"})
150 },
151 u'orm.target': {
152 'Meta': {'object_name': 'Target'},
153 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}),
154 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
155 'image_size': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
156 'is_image': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
157 'license_manifest_path': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True'}),
158 'target': ('django.db.models.fields.CharField', [], {'max_length': '100'})
159 },
160 u'orm.target_file': {
161 'Meta': {'object_name': 'Target_File'},
162 'directory': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'directory_set'", 'null': 'True', 'to': u"orm['orm.Target_File']"}),
163 'group': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
164 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
165 'inodetype': ('django.db.models.fields.IntegerField', [], {}),
166 'owner': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
167 'path': ('django.db.models.fields.FilePathField', [], {'max_length': '100'}),
168 'permission': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
169 'size': ('django.db.models.fields.IntegerField', [], {}),
170 'sym_target': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'symlink_set'", 'null': 'True', 'to': u"orm['orm.Target_File']"}),
171 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']"})
172 },
173 u'orm.target_image_file': {
174 'Meta': {'object_name': 'Target_Image_File'},
175 'file_name': ('django.db.models.fields.FilePathField', [], {'max_length': '100'}),
176 'file_size': ('django.db.models.fields.IntegerField', [], {}),
177 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
178 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']"})
179 },
180 u'orm.target_installed_package': {
181 'Meta': {'object_name': 'Target_Installed_Package'},
182 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
183 'package': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'buildtargetlist_package'", 'to': u"orm['orm.Package']"}),
184 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']"})
185 },
186 u'orm.task': {
187 'Meta': {'ordering': "('order', 'recipe')", 'unique_together': "(('build', 'recipe', 'task_name'),)", 'object_name': 'Task'},
188 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_build'", 'to': u"orm['orm.Build']"}),
189 'cpu_usage': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2'}),
190 'disk_io': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
191 'elapsed_time': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2'}),
192 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
193 'line_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
194 'logfile': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}),
195 'message': ('django.db.models.fields.CharField', [], {'max_length': '240'}),
196 'order': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
197 'outcome': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
198 'path_to_sstate_obj': ('django.db.models.fields.FilePathField', [], {'max_length': '500', 'blank': 'True'}),
199 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'build_recipe'", 'to': u"orm['orm.Recipe']"}),
200 'script_type': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
201 'source_url': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}),
202 'sstate_checksum': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
203 'sstate_result': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
204 'task_executed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
205 'task_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
206 'work_directory': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'})
207 },
208 u'orm.task_dependency': {
209 'Meta': {'object_name': 'Task_Dependency'},
210 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_dependencies_depends'", 'to': u"orm['orm.Task']"}),
211 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
212 'task': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_dependencies_task'", 'to': u"orm['orm.Task']"})
213 },
214 u'orm.variable': {
215 'Meta': {'object_name': 'Variable'},
216 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'variable_build'", 'to': u"orm['orm.Build']"}),
217 'changed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
218 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
219 'human_readable_name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
220 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
221 'variable_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
222 'variable_value': ('django.db.models.fields.TextField', [], {'blank': 'True'})
223 },
224 u'orm.variablehistory': {
225 'Meta': {'object_name': 'VariableHistory'},
226 'file_name': ('django.db.models.fields.FilePathField', [], {'max_length': '255'}),
227 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
228 'line_number': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
229 'operation': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
230 'value': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
231 'variable': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'vhistory'", 'to': u"orm['orm.Variable']"})
232 }
233 }
234
235 complete_apps = ['orm'] \ No newline at end of file
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index ba3ade06f1..6706da8a5e 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -55,6 +55,8 @@ class Target(models.Model):
55 build = models.ForeignKey(Build) 55 build = models.ForeignKey(Build)
56 target = models.CharField(max_length=100) 56 target = models.CharField(max_length=100)
57 is_image = models.BooleanField(default = False) 57 is_image = models.BooleanField(default = False)
58 image_size = models.IntegerField(default=0)
59 license_manifest_path = models.CharField(max_length=500, null=True)
58 60
59 def __str__(self): 61 def __str__(self):
60 return self.target 62 return self.target
@@ -72,7 +74,6 @@ class Target_File(models.Model):
72 ITYPE_FIFO = 5 74 ITYPE_FIFO = 5
73 ITYPE_CHARACTER = 6 75 ITYPE_CHARACTER = 6
74 ITYPE_BLOCK = 7 76 ITYPE_BLOCK = 7
75 ITYPE_SYMBLINK = 8
76 ITYPES = ( (ITYPE_REGULAR ,'regular'), 77 ITYPES = ( (ITYPE_REGULAR ,'regular'),
77 ( ITYPE_DIRECTORY ,'directory'), 78 ( ITYPE_DIRECTORY ,'directory'),
78 ( ITYPE_SYMLINK ,'symlink'), 79 ( ITYPE_SYMLINK ,'symlink'),
@@ -80,17 +81,17 @@ class Target_File(models.Model):
80 ( ITYPE_FIFO ,'fifo'), 81 ( ITYPE_FIFO ,'fifo'),
81 ( ITYPE_CHARACTER ,'character'), 82 ( ITYPE_CHARACTER ,'character'),
82 ( ITYPE_BLOCK ,'block'), 83 ( ITYPE_BLOCK ,'block'),
83 ( ITYPE_SYMLINK ,'symblink')) 84 )
84 85
85 target = models.ForeignKey(Target) 86 target = models.ForeignKey(Target)
86 path = models.FilePathField() 87 path = models.FilePathField()
87 size = models.IntegerField() 88 size = models.IntegerField()
88 inodetype = models.IntegerField(choices = ITYPES) 89 inodetype = models.IntegerField(choices = ITYPES)
89 permission = models.IntegerField() 90 permission = models.CharField(max_length=16)
90 owner = models.CharField(max_length=128) 91 owner = models.CharField(max_length=128)
91 group = models.CharField(max_length=128) 92 group = models.CharField(max_length=128)
92 directory = models.ForeignKey('Target_File', related_name="directory_set") 93 directory = models.ForeignKey('Target_File', related_name="directory_set", null=True)
93 sym_target = models.ForeignKey('Target_File', related_name="symlink_set", blank=True) 94 sym_target = models.ForeignKey('Target_File', related_name="symlink_set", null=True)
94 95
95 96
96class TaskManager(models.Manager): 97class TaskManager(models.Manager):