-- position of first image for this article
imagePos char(2) not null,
- `release` datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
+ `release` datetime DEFAULT '1990-01-01 00:00:00' NOT NULL,
expire datetime DEFAULT '2999-12-31 23:59:59' NOT NULL,
keyword varchar(255) not null default '',
Column thumbWidth;int(11);NO;;
Column thumbHeight;int(11);NO;;
Column imagePos;char(2);NO;;
-Column release;datetime;NO;0000-00-00 00:00:00;
+Column release;datetime;NO;1990-01-01 00:00:00;
Column expire;datetime;NO;2999-12-31 23:59:59;
Column keyword;varchar(255);NO;;
Column template;varchar(127);NO;;
my $sql = "alter table $table add ";
$sql .= $index->{unique} ? "unique " : "index ";
$sql .= $name . " ";
- $sql .= "(" . join(",", @{$index->{cols}}) . ")";
+ $sql .= "(" . join(",", map("`$_`", @{$index->{cols}})) . ")";
run_sql($sql)
or die "Cannot add index $name: $DBI::errstr\n";
my @results;
for my $col (@cols) {
- my $sql = $col->{field} . " " . $col->{type};
+ my $sql = "`" . $col->{field} . "` " . $col->{type};
$sql .= $col->{null} eq 'YES' ? ' null' : ' not null';
if ($col->{default} ne 'NULL' &&
($col->{type} =~ /char/i || $col->{default} =~ /\d/)) {