summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-04-28 22:11:03 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-05-08 16:18:12 +0100
commit646b089c38623cebe4a6b22c6798d21453fe5257 (patch)
tree71f62c89dba88f4d8e5f9e138338865991454f4a
parent09a1ff974362216a9ebf40e5dad86b171d161b0c (diff)
downloadpoky-646b089c38623cebe4a6b22c6798d21453fe5257.tar.gz
bitbake: toaster: modify SQL data type constraints
This patch modifies the data type constraints for the SQL fields. The original constraints have been based on guess worked, and they weren't strictly enforced for sqlite. On MySQL, the constraints are strictly enforced, and need to match the real data that we have. After measuring data on sample builds, the new constraints have been validated to work with MySQL, and this patch updates the database schema with the new field types / constraints. (Bitbake rev: aaefbc0b4e7484d6f4854ce49602821a6e4adc4b) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/toaster/orm/migrations/0008_auto__chg_field_variablehistory_operation__chg_field_recipe_descriptio.py225
-rw-r--r--bitbake/lib/toaster/orm/models.py8
2 files changed, 229 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/orm/migrations/0008_auto__chg_field_variablehistory_operation__chg_field_recipe_descriptio.py b/bitbake/lib/toaster/orm/migrations/0008_auto__chg_field_variablehistory_operation__chg_field_recipe_descriptio.py
new file mode 100644
index 0000000000..f52fc2f688
--- /dev/null
+++ b/bitbake/lib/toaster/orm/migrations/0008_auto__chg_field_variablehistory_operation__chg_field_recipe_descriptio.py
@@ -0,0 +1,225 @@
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
12 # Changing field 'VariableHistory.operation'
13 db.alter_column(u'orm_variablehistory', 'operation', self.gf('django.db.models.fields.CharField')(max_length=64))
14
15 # Changing field 'Recipe.description'
16 db.alter_column(u'orm_recipe', 'description', self.gf('django.db.models.fields.TextField')())
17
18 # Changing field 'Target_Image_File.file_name'
19 db.alter_column(u'orm_target_image_file', 'file_name', self.gf('django.db.models.fields.FilePathField')(max_length=254))
20
21 # Changing field 'Package.description'
22 db.alter_column(u'orm_package', 'description', self.gf('django.db.models.fields.TextField')())
23
24 def backwards(self, orm):
25
26 # Changing field 'VariableHistory.operation'
27 db.alter_column(u'orm_variablehistory', 'operation', self.gf('django.db.models.fields.CharField')(max_length=16))
28
29 # Changing field 'Recipe.description'
30 db.alter_column(u'orm_recipe', 'description', self.gf('django.db.models.fields.CharField')(max_length=100))
31
32 # Changing field 'Target_Image_File.file_name'
33 db.alter_column(u'orm_target_image_file', 'file_name', self.gf('django.db.models.fields.FilePathField')(max_length=100))
34
35 # Changing field 'Package.description'
36 db.alter_column(u'orm_package', 'description', self.gf('django.db.models.fields.CharField')(max_length=200))
37
38 models = {
39 u'orm.build': {
40 'Meta': {'object_name': 'Build'},
41 'bitbake_version': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
42 'build_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
43 'completed_on': ('django.db.models.fields.DateTimeField', [], {}),
44 'cooker_log_path': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
45 'distro': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
46 'distro_version': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
47 'errors_no': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
48 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
49 'machine': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
50 'outcome': ('django.db.models.fields.IntegerField', [], {'default': '2'}),
51 'started_on': ('django.db.models.fields.DateTimeField', [], {}),
52 'timespent': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
53 'warnings_no': ('django.db.models.fields.IntegerField', [], {'default': '0'})
54 },
55 u'orm.helptext': {
56 'Meta': {'object_name': 'HelpText'},
57 'area': ('django.db.models.fields.IntegerField', [], {}),
58 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'helptext_build'", 'to': u"orm['orm.Build']"}),
59 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
60 'key': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
61 'text': ('django.db.models.fields.TextField', [], {})
62 },
63 u'orm.layer': {
64 'Meta': {'object_name': 'Layer'},
65 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
66 'layer_index_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
67 'local_path': ('django.db.models.fields.FilePathField', [], {'max_length': '255'}),
68 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
69 },
70 u'orm.layer_version': {
71 'Meta': {'object_name': 'Layer_Version'},
72 'branch': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
73 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'layer_version_build'", 'to': u"orm['orm.Build']"}),
74 'commit': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
75 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
76 'layer': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'layer_version_layer'", 'to': u"orm['orm.Layer']"}),
77 'priority': ('django.db.models.fields.IntegerField', [], {})
78 },
79 u'orm.logmessage': {
80 'Meta': {'object_name': 'LogMessage'},
81 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}),
82 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
83 'level': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
84 'lineno': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
85 'message': ('django.db.models.fields.CharField', [], {'max_length': '240'}),
86 'pathname': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}),
87 'task': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Task']", 'null': 'True', 'blank': 'True'})
88 },
89 u'orm.package': {
90 'Meta': {'object_name': 'Package'},
91 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}),
92 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
93 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
94 'installed_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'}),
95 'installed_size': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
96 'license': ('django.db.models.fields.CharField', [], {'max_length': '80', 'blank': 'True'}),
97 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
98 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Recipe']", 'null': 'True'}),
99 'revision': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}),
100 'section': ('django.db.models.fields.CharField', [], {'max_length': '80', 'blank': 'True'}),
101 'size': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
102 'summary': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
103 'version': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'})
104 },
105 u'orm.package_dependency': {
106 'Meta': {'object_name': 'Package_Dependency'},
107 'dep_type': ('django.db.models.fields.IntegerField', [], {}),
108 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'package_dependencies_target'", 'to': u"orm['orm.Package']"}),
109 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
110 'package': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'package_dependencies_source'", 'to': u"orm['orm.Package']"}),
111 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']", 'null': 'True'})
112 },
113 u'orm.package_file': {
114 'Meta': {'object_name': 'Package_File'},
115 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
116 'package': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'buildfilelist_package'", 'to': u"orm['orm.Package']"}),
117 'path': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}),
118 'size': ('django.db.models.fields.IntegerField', [], {})
119 },
120 u'orm.recipe': {
121 'Meta': {'object_name': 'Recipe'},
122 'bugtracker': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
123 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
124 'file_path': ('django.db.models.fields.FilePathField', [], {'max_length': '255'}),
125 'homepage': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
126 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
127 'layer_version': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'recipe_layer_version'", 'to': u"orm['orm.Layer_Version']"}),
128 'license': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
129 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
130 'section': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
131 'summary': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
132 'version': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'})
133 },
134 u'orm.recipe_dependency': {
135 'Meta': {'object_name': 'Recipe_Dependency'},
136 'dep_type': ('django.db.models.fields.IntegerField', [], {}),
137 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'r_dependencies_depends'", 'to': u"orm['orm.Recipe']"}),
138 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
139 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'r_dependencies_recipe'", 'to': u"orm['orm.Recipe']"})
140 },
141 u'orm.target': {
142 'Meta': {'object_name': 'Target'},
143 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}),
144 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
145 'image_size': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
146 'is_image': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
147 'license_manifest_path': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True'}),
148 'target': ('django.db.models.fields.CharField', [], {'max_length': '100'})
149 },
150 u'orm.target_file': {
151 'Meta': {'object_name': 'Target_File'},
152 'directory': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'directory_set'", 'null': 'True', 'to': u"orm['orm.Target_File']"}),
153 'group': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
154 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
155 'inodetype': ('django.db.models.fields.IntegerField', [], {}),
156 'owner': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
157 'path': ('django.db.models.fields.FilePathField', [], {'max_length': '100'}),
158 'permission': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
159 'size': ('django.db.models.fields.IntegerField', [], {}),
160 'sym_target': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'symlink_set'", 'null': 'True', 'to': u"orm['orm.Target_File']"}),
161 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']"})
162 },
163 u'orm.target_image_file': {
164 'Meta': {'object_name': 'Target_Image_File'},
165 'file_name': ('django.db.models.fields.FilePathField', [], {'max_length': '254'}),
166 'file_size': ('django.db.models.fields.IntegerField', [], {}),
167 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
168 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']"})
169 },
170 u'orm.target_installed_package': {
171 'Meta': {'object_name': 'Target_Installed_Package'},
172 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
173 'package': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'buildtargetlist_package'", 'to': u"orm['orm.Package']"}),
174 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']"})
175 },
176 u'orm.task': {
177 'Meta': {'ordering': "('order', 'recipe')", 'unique_together': "(('build', 'recipe', 'task_name'),)", 'object_name': 'Task'},
178 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_build'", 'to': u"orm['orm.Build']"}),
179 'cpu_usage': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2'}),
180 'disk_io': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
181 'elapsed_time': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2'}),
182 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
183 'line_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
184 'logfile': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}),
185 'message': ('django.db.models.fields.CharField', [], {'max_length': '240'}),
186 'order': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
187 'outcome': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
188 'path_to_sstate_obj': ('django.db.models.fields.FilePathField', [], {'max_length': '500', 'blank': 'True'}),
189 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'build_recipe'", 'to': u"orm['orm.Recipe']"}),
190 'script_type': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
191 'source_url': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}),
192 'sstate_checksum': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
193 'sstate_result': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
194 'task_executed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
195 'task_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
196 'work_directory': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'})
197 },
198 u'orm.task_dependency': {
199 'Meta': {'object_name': 'Task_Dependency'},
200 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_dependencies_depends'", 'to': u"orm['orm.Task']"}),
201 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
202 'task': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_dependencies_task'", 'to': u"orm['orm.Task']"})
203 },
204 u'orm.variable': {
205 'Meta': {'object_name': 'Variable'},
206 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'variable_build'", 'to': u"orm['orm.Build']"}),
207 'changed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
208 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
209 'human_readable_name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
210 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
211 'variable_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
212 'variable_value': ('django.db.models.fields.TextField', [], {'blank': 'True'})
213 },
214 u'orm.variablehistory': {
215 'Meta': {'object_name': 'VariableHistory'},
216 'file_name': ('django.db.models.fields.FilePathField', [], {'max_length': '255'}),
217 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
218 'line_number': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
219 'operation': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
220 'value': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
221 'variable': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'vhistory'", 'to': u"orm['orm.Variable']"})
222 }
223 }
224
225 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 22c66a9a28..8aa7126a9b 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -72,7 +72,7 @@ class Target(models.Model):
72 72
73class Target_Image_File(models.Model): 73class Target_Image_File(models.Model):
74 target = models.ForeignKey(Target) 74 target = models.ForeignKey(Target)
75 file_name = models.FilePathField(max_length=100) 75 file_name = models.FilePathField(max_length=254)
76 file_size = models.IntegerField() 76 file_size = models.IntegerField()
77 77
78class Target_File(models.Model): 78class Target_File(models.Model):
@@ -230,7 +230,7 @@ class Package(models.Model):
230 version = models.CharField(max_length=100, blank=True) 230 version = models.CharField(max_length=100, blank=True)
231 revision = models.CharField(max_length=32, blank=True) 231 revision = models.CharField(max_length=32, blank=True)
232 summary = models.CharField(max_length=200, blank=True) 232 summary = models.CharField(max_length=200, blank=True)
233 description = models.CharField(max_length=200, blank=True) 233 description = models.TextField(blank=True)
234 size = models.IntegerField(default=0) 234 size = models.IntegerField(default=0)
235 installed_size = models.IntegerField(default=0) 235 installed_size = models.IntegerField(default=0)
236 section = models.CharField(max_length=80, blank=True) 236 section = models.CharField(max_length=80, blank=True)
@@ -298,7 +298,7 @@ class Recipe(models.Model):
298 version = models.CharField(max_length=100, blank=True) 298 version = models.CharField(max_length=100, blank=True)
299 layer_version = models.ForeignKey('Layer_Version', related_name='recipe_layer_version') 299 layer_version = models.ForeignKey('Layer_Version', related_name='recipe_layer_version')
300 summary = models.CharField(max_length=100, blank=True) 300 summary = models.CharField(max_length=100, blank=True)
301 description = models.CharField(max_length=100, blank=True) 301 description = models.TextField(blank=True)
302 section = models.CharField(max_length=100, blank=True) 302 section = models.CharField(max_length=100, blank=True)
303 license = models.CharField(max_length=200, blank=True) 303 license = models.CharField(max_length=200, blank=True)
304 homepage = models.URLField(blank=True) 304 homepage = models.URLField(blank=True)
@@ -353,7 +353,7 @@ class VariableHistory(models.Model):
353 value = models.TextField(blank=True) 353 value = models.TextField(blank=True)
354 file_name = models.FilePathField(max_length=255) 354 file_name = models.FilePathField(max_length=255)
355 line_number = models.IntegerField(null=True) 355 line_number = models.IntegerField(null=True)
356 operation = models.CharField(max_length=16) 356 operation = models.CharField(max_length=64)
357 357
358class HelpText(models.Model): 358class HelpText(models.Model):
359 VARIABLE = 0 359 VARIABLE = 0