... | ... |
@@ -242,4 +242,32 @@ EOS |
242 | 242 |
my $error = "Can't create pull_request table properly: $@"; |
243 | 243 |
die $error; |
244 | 244 |
} |
245 |
+ |
|
246 |
+ # Create label table |
|
247 |
+ eval { |
|
248 |
+ my $sql = <<"EOS"; |
|
249 |
+create table label ( |
|
250 |
+ row_id integer primary key autoincrement, |
|
251 |
+ project integer not null default 0, |
|
252 |
+ id varchar(100) not null default '', |
|
253 |
+ unique(project, id) |
|
254 |
+); |
|
255 |
+EOS |
|
256 |
+ $dbi->execute($sql); |
|
257 |
+ }; |
|
258 |
+ |
|
259 |
+ # Create label columns |
|
260 |
+ my @label_columns = ( |
|
261 |
+ "color not null default ''" |
|
262 |
+ ); |
|
263 |
+ for my $column (@label_columns) { |
|
264 |
+ eval { $dbi->execute("alter table label add column $column") }; |
|
265 |
+ } |
|
266 |
+ |
|
267 |
+ # Check label table |
|
268 |
+ eval { $dbi->select([qw/row_id project id color/], table => 'label') }; |
|
269 |
+ if ($@) { |
|
270 |
+ my $error = "Can't create label table properly: $@"; |
|
271 |
+ die $error; |
|
272 |
+ } |
|
245 | 273 |
} |