| ... | ... |
@@ -270,4 +270,31 @@ EOS |
| 270 | 270 |
my $error = "Can't create label table properly: $@"; |
| 271 | 271 |
die $error; |
| 272 | 272 |
} |
| 273 |
+ |
|
| 274 |
+ # Create issue_label table |
|
| 275 |
+ eval {
|
|
| 276 |
+ my $sql = <<"EOS"; |
|
| 277 |
+create table issue_label ( |
|
| 278 |
+ row_id integer primary key autoincrement, |
|
| 279 |
+ issue integer not null default 0, |
|
| 280 |
+ label integer not null default 0, |
|
| 281 |
+ unique(issue, label) |
|
| 282 |
+); |
|
| 283 |
+EOS |
|
| 284 |
+ $dbi->execute($sql); |
|
| 285 |
+ }; |
|
| 286 |
+ |
|
| 287 |
+ # Create issue_label columns |
|
| 288 |
+ my @issue_label_columns = ( |
|
| 289 |
+ ); |
|
| 290 |
+ for my $column (@issue_label_columns) {
|
|
| 291 |
+ eval { $dbi->execute("alter table issue_label add column $column") };
|
|
| 292 |
+ } |
|
| 293 |
+ |
|
| 294 |
+ # Check issue_label table |
|
| 295 |
+ eval { $dbi->select([qw/row_id issue label/], table => 'issue_label') };
|
|
| 296 |
+ if ($@) {
|
|
| 297 |
+ my $error = "Can't create issue_label table properly: $@"; |
|
| 298 |
+ die $error; |
|
| 299 |
+ } |
|
| 273 | 300 |
} |