Line 0
Link Here
|
|
|
1 |
use Modern::Perl; |
2 |
|
3 |
return { |
4 |
bug_number => "33478", |
5 |
description => "Customise the format of notices when they are printed", |
6 |
up => sub { |
7 |
my ($args) = @_; |
8 |
my ($dbh, $out) = @$args{qw(dbh out)}; |
9 |
|
10 |
if( !column_exists( 'letter', 'font' ) ) { |
11 |
$dbh->do(q{ |
12 |
ALTER TABLE letter ADD COLUMN `font` char(10) NOT NULL DEFAULT 'TR' AFTER `updated_on` |
13 |
}); |
14 |
|
15 |
say $out "Added column 'letter.font'"; |
16 |
} |
17 |
|
18 |
if( !column_exists( 'letter', 'font_size' ) ) { |
19 |
$dbh->do(q{ |
20 |
ALTER TABLE letter ADD COLUMN `font_size` int(4) NOT NULL DEFAULT 10 AFTER `font` |
21 |
}); |
22 |
|
23 |
say $out "Added column 'letter.font_size'"; |
24 |
} |
25 |
|
26 |
if( !column_exists( 'letter', 'text_justify' ) ) { |
27 |
$dbh->do(q{ |
28 |
ALTER TABLE letter ADD COLUMN `text_justify` char(1) NOT NULL DEFAULT 'L' AFTER `font_size` |
29 |
}); |
30 |
|
31 |
say $out "Added column 'letter.text_justify'"; |
32 |
} |
33 |
|
34 |
if( !column_exists( 'letter', 'units' ) ) { |
35 |
$dbh->do(q{ |
36 |
ALTER TABLE letter ADD COLUMN `units` char(20) NOT NULL DEFAULT 'INCH' AFTER `text_justify` |
37 |
}); |
38 |
|
39 |
say $out "Added column 'letter.units'"; |
40 |
} |
41 |
|
42 |
if( !column_exists( 'letter', 'notice_width' ) ) { |
43 |
$dbh->do(q{ |
44 |
ALTER TABLE letter ADD COLUMN `notice_width` float NOT NULL DEFAULT 8.5 AFTER `units` |
45 |
}); |
46 |
|
47 |
say $out "Added column 'letter.notice_width'"; |
48 |
} |
49 |
|
50 |
if( !column_exists( 'letter', 'notice_length' ) ) { |
51 |
$dbh->do(q{ |
52 |
ALTER TABLE letter ADD COLUMN `notice_length` float NOT NULL DEFAULT 11 AFTER `notice_width` |
53 |
}); |
54 |
|
55 |
say $out "Added column 'letter.notice_length'"; |
56 |
} |
57 |
|
58 |
if( !column_exists( 'letter', 'page_width' ) ) { |
59 |
$dbh->do(q{ |
60 |
ALTER TABLE letter ADD COLUMN `page_width` float NOT NULL DEFAULT 8.5 AFTER `notice_width` |
61 |
}); |
62 |
|
63 |
say $out "Added column 'letter.page_width'"; |
64 |
} |
65 |
|
66 |
if( !column_exists( 'letter', 'page_length' ) ) { |
67 |
$dbh->do(q{ |
68 |
ALTER TABLE letter ADD COLUMN `page_length` float NOT NULL DEFAULT 11 AFTER `page_width` |
69 |
}); |
70 |
|
71 |
say $out "Added column 'letter.page_length'"; |
72 |
} |
73 |
|
74 |
if( !column_exists( 'letter', 'top_text_margin' ) ) { |
75 |
$dbh->do(q{ |
76 |
ALTER TABLE letter ADD COLUMN `top_text_margin` float NOT NULL DEFAULT 0 AFTER `page_length` |
77 |
}); |
78 |
|
79 |
say $out "Added column 'letter.top_text_margin'"; |
80 |
} |
81 |
|
82 |
if( !column_exists( 'letter', 'left_text_margin' ) ) { |
83 |
$dbh->do(q{ |
84 |
ALTER TABLE letter ADD COLUMN `left_text_margin` float NOT NULL DEFAULT 0 AFTER `top_text_margin` |
85 |
}); |
86 |
|
87 |
say $out "Added column 'letter.left_text_margin'"; |
88 |
} |
89 |
|
90 |
if( !column_exists( 'letter', 'top_margin' ) ) { |
91 |
$dbh->do(q{ |
92 |
ALTER TABLE letter ADD COLUMN `top_margin` float NOT NULL DEFAULT 0.5 AFTER `left_text_margin` |
93 |
}); |
94 |
|
95 |
say $out "Added column 'letter.top_margin'"; |
96 |
} |
97 |
|
98 |
if( !column_exists( 'letter', 'left_margin' ) ) { |
99 |
$dbh->do(q{ |
100 |
ALTER TABLE letter ADD COLUMN `left_margin` float NOT NULL DEFAULT 0.5 AFTER `top_margin` |
101 |
}); |
102 |
|
103 |
say $out "Added column 'letter.left_margin'"; |
104 |
} |
105 |
|
106 |
if( !column_exists( 'letter', 'cols' ) ) { |
107 |
$dbh->do(q{ |
108 |
ALTER TABLE letter ADD COLUMN `cols` float NOT NULL DEFAULT 1 AFTER `left_margin` |
109 |
}); |
110 |
|
111 |
say $out "Added column 'letter.cols'"; |
112 |
} |
113 |
|
114 |
if( !column_exists( 'letter', 'rows' ) ) { |
115 |
$dbh->do(q{ |
116 |
ALTER TABLE letter ADD COLUMN `rows` float NOT NULL DEFAULT 1 AFTER `cols` |
117 |
}); |
118 |
|
119 |
say $out "Added column 'letter.rows'"; |
120 |
} |
121 |
|
122 |
if( !column_exists( 'letter', 'col_gap' ) ) { |
123 |
$dbh->do(q{ |
124 |
ALTER TABLE letter ADD COLUMN `col_gap` float NOT NULL DEFAULT 0 AFTER `rows` |
125 |
}); |
126 |
|
127 |
say $out "Added column 'letter.col_gap'"; |
128 |
} |
129 |
|
130 |
if( !column_exists( 'letter', 'row_gap' ) ) { |
131 |
$dbh->do(q{ |
132 |
ALTER TABLE letter ADD COLUMN `row_gap` float NOT NULL DEFAULT 0 AFTER `col_gap` |
133 |
}); |
134 |
|
135 |
say $out "Added column 'letter.row_gap'"; |
136 |
} |
137 |
}, |
138 |
}; |