summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/orm
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-02-20 12:47:55 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-09 12:24:01 -0700
commit24f0617e257fef82e66adb0b89ceeb07984758bf (patch)
treebca2489d82e3c1418c907ea47a8aae7d11cd09b2 /bitbake/lib/toaster/orm
parent0bad725381d0e09017a840d27bc1601edcd84a13 (diff)
downloadpoky-24f0617e257fef82e66adb0b89ceeb07984758bf.tar.gz
bitbake: toaster: update database schema
This patch updates the database schema to resolve a number of issues discovered while implementing the UI interface. We do not expect that all the data will come in valid at this point. [YOCTO #5453] [YOCTO #5833] [YOCTO #5836] [YOCTO #5811] [YOCTO #5812] [YOCTO #5820] (Bitbake rev: f8ad96d10a095e21fd2ce424c45e17f54642fb54) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/orm')
-rw-r--r--bitbake/lib/toaster/orm/migrations/0005_auto__add_target_image_file__add_target_file__add_field_variablehistor.py301
-rw-r--r--bitbake/lib/toaster/orm/models.py45
2 files changed, 338 insertions, 8 deletions
diff --git a/bitbake/lib/toaster/orm/migrations/0005_auto__add_target_image_file__add_target_file__add_field_variablehistor.py b/bitbake/lib/toaster/orm/migrations/0005_auto__add_target_image_file__add_target_file__add_field_variablehistor.py
new file mode 100644
index 0000000000..a55451c6da
--- /dev/null
+++ b/bitbake/lib/toaster/orm/migrations/0005_auto__add_target_image_file__add_target_file__add_field_variablehistor.py
@@ -0,0 +1,301 @@
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 model 'Target_Image_File'
12 db.create_table(u'orm_target_image_file', (
13 (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14 ('target', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['orm.Target'])),
15 ('file_name', self.gf('django.db.models.fields.FilePathField')(max_length=100)),
16 ('file_size', self.gf('django.db.models.fields.IntegerField')()),
17 ))
18 db.send_create_signal(u'orm', ['Target_Image_File'])
19
20 # Adding model 'Target_File'
21 db.create_table(u'orm_target_file', (
22 (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
23 ('target', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['orm.Target'])),
24 ('path', self.gf('django.db.models.fields.FilePathField')(max_length=100)),
25 ('size', self.gf('django.db.models.fields.IntegerField')()),
26 ('inodetype', self.gf('django.db.models.fields.IntegerField')()),
27 ('permission', self.gf('django.db.models.fields.IntegerField')()),
28 ('owner', self.gf('django.db.models.fields.CharField')(max_length=128)),
29 ('group', self.gf('django.db.models.fields.CharField')(max_length=128)),
30 ('directory', self.gf('django.db.models.fields.related.ForeignKey')(related_name='directory_set', to=orm['orm.Target_File'])),
31 ('sym_target', self.gf('django.db.models.fields.related.ForeignKey')(related_name='symlink_set', blank=True, to=orm['orm.Target_File'])),
32 ))
33 db.send_create_signal(u'orm', ['Target_File'])
34
35 # Adding field 'VariableHistory.value'
36 db.add_column(u'orm_variablehistory', 'value',
37 self.gf('django.db.models.fields.TextField')(default='', blank=True),
38 keep_default=False)
39
40 # Deleting field 'Recipe.licensing_info'
41 db.delete_column(u'orm_recipe', 'licensing_info')
42
43 # Deleting field 'Target.file_name'
44 db.delete_column(u'orm_target', 'file_name')
45
46 # Deleting field 'Target.file_size'
47 db.delete_column(u'orm_target', 'file_size')
48
49 # Deleting field 'Build.image_fstypes'
50 db.delete_column(u'orm_build', 'image_fstypes')
51
52 # Adding field 'Build.timespent'
53 db.add_column(u'orm_build', 'timespent',
54 self.gf('django.db.models.fields.IntegerField')(default=0),
55 keep_default=False)
56
57 # Adding field 'LogMessage.task'
58 db.add_column(u'orm_logmessage', 'task',
59 self.gf('django.db.models.fields.related.ForeignKey')(to=orm['orm.Task'], null=True, blank=True),
60 keep_default=False)
61
62
63 # Changing field 'Task.elapsed_time'
64 db.alter_column(u'orm_task', 'elapsed_time', self.gf('django.db.models.fields.DecimalField')(null=True, max_digits=6, decimal_places=2))
65 # Adding unique constraint on 'Task', fields ['build', 'recipe', 'task_name']
66 db.create_unique(u'orm_task', ['build_id', 'recipe_id', 'task_name'])
67
68
69 def backwards(self, orm):
70 # Removing unique constraint on 'Task', fields ['build', 'recipe', 'task_name']
71 db.delete_unique(u'orm_task', ['build_id', 'recipe_id', 'task_name'])
72
73 # Deleting model 'Target_Image_File'
74 db.delete_table(u'orm_target_image_file')
75
76 # Deleting model 'Target_File'
77 db.delete_table(u'orm_target_file')
78
79 # Deleting field 'VariableHistory.value'
80 db.delete_column(u'orm_variablehistory', 'value')
81
82 # Adding field 'Recipe.licensing_info'
83 db.add_column(u'orm_recipe', 'licensing_info',
84 self.gf('django.db.models.fields.TextField')(default='', blank=True),
85 keep_default=False)
86
87
88 # User chose to not deal with backwards NULL issues for 'Target.file_name'
89 raise RuntimeError("Cannot reverse this migration. 'Target.file_name' and its values cannot be restored.")
90
91 # The following code is provided here to aid in writing a correct migration # Adding field 'Target.file_name'
92 db.add_column(u'orm_target', 'file_name',
93 self.gf('django.db.models.fields.CharField')(max_length=100),
94 keep_default=False)
95
96
97 # User chose to not deal with backwards NULL issues for 'Target.file_size'
98 raise RuntimeError("Cannot reverse this migration. 'Target.file_size' and its values cannot be restored.")
99
100 # The following code is provided here to aid in writing a correct migration # Adding field 'Target.file_size'
101 db.add_column(u'orm_target', 'file_size',
102 self.gf('django.db.models.fields.IntegerField')(),
103 keep_default=False)
104
105
106 # User chose to not deal with backwards NULL issues for 'Build.image_fstypes'
107 raise RuntimeError("Cannot reverse this migration. 'Build.image_fstypes' and its values cannot be restored.")
108
109 # The following code is provided here to aid in writing a correct migration # Adding field 'Build.image_fstypes'
110 db.add_column(u'orm_build', 'image_fstypes',
111 self.gf('django.db.models.fields.CharField')(max_length=100),
112 keep_default=False)
113
114 # Deleting field 'Build.timespent'
115 db.delete_column(u'orm_build', 'timespent')
116
117 # Deleting field 'LogMessage.task'
118 db.delete_column(u'orm_logmessage', 'task_id')
119
120
121 # Changing field 'Task.elapsed_time'
122 db.alter_column(u'orm_task', 'elapsed_time', self.gf('django.db.models.fields.CharField')(max_length=50))
123
124 models = {
125 u'orm.build': {
126 'Meta': {'object_name': 'Build'},
127 'bitbake_version': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
128 'build_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
129 'completed_on': ('django.db.models.fields.DateTimeField', [], {}),
130 'cooker_log_path': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
131 'distro': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
132 'distro_version': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
133 'errors_no': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
134 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
135 'machine': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
136 'outcome': ('django.db.models.fields.IntegerField', [], {'default': '2'}),
137 'started_on': ('django.db.models.fields.DateTimeField', [], {}),
138 'timespent': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
139 'warnings_no': ('django.db.models.fields.IntegerField', [], {'default': '0'})
140 },
141 u'orm.layer': {
142 'Meta': {'object_name': 'Layer'},
143 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
144 'layer_index_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
145 'local_path': ('django.db.models.fields.FilePathField', [], {'max_length': '255'}),
146 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
147 },
148 u'orm.layer_version': {
149 'Meta': {'object_name': 'Layer_Version'},
150 'branch': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
151 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'layer_version_build'", 'to': u"orm['orm.Build']"}),
152 'commit': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
153 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
154 'layer': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'layer_version_layer'", 'to': u"orm['orm.Layer']"}),
155 'priority': ('django.db.models.fields.IntegerField', [], {})
156 },
157 u'orm.logmessage': {
158 'Meta': {'object_name': 'LogMessage'},
159 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}),
160 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
161 'level': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
162 'lineno': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
163 'message': ('django.db.models.fields.CharField', [], {'max_length': '240'}),
164 'pathname': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}),
165 'task': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Task']", 'null': 'True', 'blank': 'True'})
166 },
167 u'orm.package': {
168 'Meta': {'object_name': 'Package'},
169 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}),
170 'description': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
171 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
172 'installed_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'}),
173 'installed_size': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
174 'license': ('django.db.models.fields.CharField', [], {'max_length': '80', 'blank': 'True'}),
175 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
176 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Recipe']", 'null': 'True'}),
177 'revision': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}),
178 'section': ('django.db.models.fields.CharField', [], {'max_length': '80', 'blank': 'True'}),
179 'size': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
180 'summary': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
181 'version': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'})
182 },
183 u'orm.package_dependency': {
184 'Meta': {'object_name': 'Package_Dependency'},
185 'dep_type': ('django.db.models.fields.IntegerField', [], {}),
186 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'package_dependencies_target'", 'to': u"orm['orm.Package']"}),
187 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
188 'package': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'package_dependencies_source'", 'to': u"orm['orm.Package']"}),
189 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']", 'null': 'True'})
190 },
191 u'orm.package_file': {
192 'Meta': {'object_name': 'Package_File'},
193 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
194 'package': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'buildfilelist_package'", 'to': u"orm['orm.Package']"}),
195 'path': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}),
196 'size': ('django.db.models.fields.IntegerField', [], {})
197 },
198 u'orm.recipe': {
199 'Meta': {'object_name': 'Recipe'},
200 'bugtracker': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
201 'description': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
202 'file_path': ('django.db.models.fields.FilePathField', [], {'max_length': '255'}),
203 'homepage': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
204 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
205 'layer_version': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'recipe_layer_version'", 'to': u"orm['orm.Layer_Version']"}),
206 'license': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
207 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
208 'section': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
209 'summary': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
210 'version': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'})
211 },
212 u'orm.recipe_dependency': {
213 'Meta': {'object_name': 'Recipe_Dependency'},
214 'dep_type': ('django.db.models.fields.IntegerField', [], {}),
215 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'r_dependencies_depends'", 'to': u"orm['orm.Recipe']"}),
216 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
217 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'r_dependencies_recipe'", 'to': u"orm['orm.Recipe']"})
218 },
219 u'orm.target': {
220 'Meta': {'object_name': 'Target'},
221 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}),
222 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
223 'is_image': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
224 'target': ('django.db.models.fields.CharField', [], {'max_length': '100'})
225 },
226 u'orm.target_file': {
227 'Meta': {'object_name': 'Target_File'},
228 'directory': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'directory_set'", 'to': u"orm['orm.Target_File']"}),
229 'group': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
230 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
231 'inodetype': ('django.db.models.fields.IntegerField', [], {}),
232 'owner': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
233 'path': ('django.db.models.fields.FilePathField', [], {'max_length': '100'}),
234 'permission': ('django.db.models.fields.IntegerField', [], {}),
235 'size': ('django.db.models.fields.IntegerField', [], {}),
236 'sym_target': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'symlink_set'", 'blank': 'True', 'to': u"orm['orm.Target_File']"}),
237 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']"})
238 },
239 u'orm.target_image_file': {
240 'Meta': {'object_name': 'Target_Image_File'},
241 'file_name': ('django.db.models.fields.FilePathField', [], {'max_length': '100'}),
242 'file_size': ('django.db.models.fields.IntegerField', [], {}),
243 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
244 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']"})
245 },
246 u'orm.target_installed_package': {
247 'Meta': {'object_name': 'Target_Installed_Package'},
248 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
249 'package': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'buildtargetlist_package'", 'to': u"orm['orm.Package']"}),
250 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']"})
251 },
252 u'orm.task': {
253 'Meta': {'ordering': "('order', 'recipe')", 'unique_together': "(('build', 'recipe', 'task_name'),)", 'object_name': 'Task'},
254 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_build'", 'to': u"orm['orm.Build']"}),
255 'cpu_usage': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2'}),
256 'disk_io': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
257 'elapsed_time': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2'}),
258 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
259 'line_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
260 'logfile': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}),
261 'message': ('django.db.models.fields.CharField', [], {'max_length': '240'}),
262 'order': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
263 'outcome': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
264 'path_to_sstate_obj': ('django.db.models.fields.FilePathField', [], {'max_length': '500', 'blank': 'True'}),
265 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'build_recipe'", 'to': u"orm['orm.Recipe']"}),
266 'script_type': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
267 'source_url': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}),
268 'sstate_checksum': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
269 'sstate_result': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
270 'task_executed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
271 'task_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
272 'work_directory': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'})
273 },
274 u'orm.task_dependency': {
275 'Meta': {'object_name': 'Task_Dependency'},
276 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_dependencies_depends'", 'to': u"orm['orm.Task']"}),
277 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
278 'task': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_dependencies_task'", 'to': u"orm['orm.Task']"})
279 },
280 u'orm.variable': {
281 'Meta': {'object_name': 'Variable'},
282 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'variable_build'", 'to': u"orm['orm.Build']"}),
283 'changed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
284 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
285 'human_readable_name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
286 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
287 'variable_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
288 'variable_value': ('django.db.models.fields.TextField', [], {'blank': 'True'})
289 },
290 u'orm.variablehistory': {
291 'Meta': {'object_name': 'VariableHistory'},
292 'file_name': ('django.db.models.fields.FilePathField', [], {'max_length': '255'}),
293 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
294 'line_number': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
295 'operation': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
296 'value': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
297 'variable': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'vhistory'", 'to': u"orm['orm.Variable']"})
298 }
299 }
300
301 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 abc16d9b88..ba3ade06f1 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -34,11 +34,9 @@ class Build(models.Model):
34 (IN_PROGRESS, 'In Progress'), 34 (IN_PROGRESS, 'In Progress'),
35 ) 35 )
36 36
37 search_allowed_fields = ['machine', 'image_fstypes', 37 search_allowed_fields = ['machine', 'cooker_log_path', "target__target", "target__target_image_file__file_name"]
38 'cooker_log_path', "target__target"]
39 38
40 machine = models.CharField(max_length=100) 39 machine = models.CharField(max_length=100)
41 image_fstypes = models.CharField(max_length=100)
42 distro = models.CharField(max_length=100) 40 distro = models.CharField(max_length=100)
43 distro_version = models.CharField(max_length=100) 41 distro_version = models.CharField(max_length=100)
44 started_on = models.DateTimeField() 42 started_on = models.DateTimeField()
@@ -53,16 +51,46 @@ class Build(models.Model):
53 51
54@python_2_unicode_compatible 52@python_2_unicode_compatible
55class Target(models.Model): 53class Target(models.Model):
56 search_allowed_fields = ['target', 'image_fstypes', 'file_name'] 54 search_allowed_fields = ['target', 'file_name']
57 build = models.ForeignKey(Build) 55 build = models.ForeignKey(Build)
58 target = models.CharField(max_length=100) 56 target = models.CharField(max_length=100)
59 is_image = models.BooleanField(default = False) 57 is_image = models.BooleanField(default = False)
60 file_name = models.CharField(max_length=100)
61 file_size = models.IntegerField()
62 58
63 def __str__(self): 59 def __str__(self):
64 return self.target 60 return self.target
65 61
62class Target_Image_File(models.Model):
63 target = models.ForeignKey(Target)
64 file_name = models.FilePathField(max_length=100)
65 file_size = models.IntegerField()
66
67class Target_File(models.Model):
68 ITYPE_REGULAR = 1
69 ITYPE_DIRECTORY = 2
70 ITYPE_SYMLINK = 3
71 ITYPE_SOCKET = 4
72 ITYPE_FIFO = 5
73 ITYPE_CHARACTER = 6
74 ITYPE_BLOCK = 7
75 ITYPE_SYMBLINK = 8
76 ITYPES = ( (ITYPE_REGULAR ,'regular'),
77 ( ITYPE_DIRECTORY ,'directory'),
78 ( ITYPE_SYMLINK ,'symlink'),
79 ( ITYPE_SOCKET ,'socket'),
80 ( ITYPE_FIFO ,'fifo'),
81 ( ITYPE_CHARACTER ,'character'),
82 ( ITYPE_BLOCK ,'block'),
83 ( ITYPE_SYMLINK ,'symblink'))
84
85 target = models.ForeignKey(Target)
86 path = models.FilePathField()
87 size = models.IntegerField()
88 inodetype = models.IntegerField(choices = ITYPES)
89 permission = models.IntegerField()
90 owner = models.CharField(max_length=128)
91 group = models.CharField(max_length=128)
92 directory = models.ForeignKey('Target_File', related_name="directory_set")
93 sym_target = models.ForeignKey('Target_File', related_name="symlink_set", blank=True)
66 94
67 95
68class TaskManager(models.Manager): 96class TaskManager(models.Manager):
@@ -149,7 +177,7 @@ class Task(models.Model):
149 line_number = models.IntegerField(default=0) 177 line_number = models.IntegerField(default=0)
150 disk_io = models.IntegerField(null=True) 178 disk_io = models.IntegerField(null=True)
151 cpu_usage = models.DecimalField(max_digits=6, decimal_places=2, null=True) 179 cpu_usage = models.DecimalField(max_digits=6, decimal_places=2, null=True)
152 elapsed_time = models.CharField(max_length=50, default=0) 180 elapsed_time = models.DecimalField(max_digits=6, decimal_places=2, null=True)
153 sstate_result = models.IntegerField(choices=SSTATE_RESULT, default=SSTATE_NA) 181 sstate_result = models.IntegerField(choices=SSTATE_RESULT, default=SSTATE_NA)
154 message = models.CharField(max_length=240) 182 message = models.CharField(max_length=240)
155 logfile = models.FilePathField(max_length=255, blank=True) 183 logfile = models.FilePathField(max_length=255, blank=True)
@@ -236,7 +264,6 @@ class Recipe(models.Model):
236 description = models.CharField(max_length=100, blank=True) 264 description = models.CharField(max_length=100, blank=True)
237 section = models.CharField(max_length=100, blank=True) 265 section = models.CharField(max_length=100, blank=True)
238 license = models.CharField(max_length=200, blank=True) 266 license = models.CharField(max_length=200, blank=True)
239 licensing_info = models.TextField(blank=True)
240 homepage = models.URLField(blank=True) 267 homepage = models.URLField(blank=True)
241 bugtracker = models.URLField(blank=True) 268 bugtracker = models.URLField(blank=True)
242 file_path = models.FilePathField(max_length=255) 269 file_path = models.FilePathField(max_length=255)
@@ -280,6 +307,7 @@ class Variable(models.Model):
280 307
281class VariableHistory(models.Model): 308class VariableHistory(models.Model):
282 variable = models.ForeignKey(Variable, related_name='vhistory') 309 variable = models.ForeignKey(Variable, related_name='vhistory')
310 value = models.TextField(blank=True)
283 file_name = models.FilePathField(max_length=255) 311 file_name = models.FilePathField(max_length=255)
284 line_number = models.IntegerField(null=True) 312 line_number = models.IntegerField(null=True)
285 operation = models.CharField(max_length=16) 313 operation = models.CharField(max_length=16)
@@ -294,6 +322,7 @@ class LogMessage(models.Model):
294 (ERROR, "error") ) 322 (ERROR, "error") )
295 323
296 build = models.ForeignKey(Build) 324 build = models.ForeignKey(Build)
325 task = models.ForeignKey(Task, blank = True, null=True)
297 level = models.IntegerField(choices=LOG_LEVEL, default=INFO) 326 level = models.IntegerField(choices=LOG_LEVEL, default=INFO)
298 message=models.CharField(max_length=240) 327 message=models.CharField(max_length=240)
299 pathname = models.FilePathField(max_length=255, blank=True) 328 pathname = models.FilePathField(max_length=255, blank=True)