Skip to content

Commit bf2d794

Browse files
committed
Item15084: MySQL does not understand CREATE INDEX IF NOT EXISTS
1 parent 43d778a commit bf2d794

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

lib/Foswiki/DBI/Schema/MySQL.pm

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,23 @@ package Foswiki::DBI::Schema::MySQL;
1818
use strict;
1919
use warnings;
2020

21-
use Foswiki::DBI::Schema::MariaDB;
22-
our @ISA = ('Foswiki::DBI::Schema::MariaDB');
21+
use Foswiki::DBI::Schema;
22+
our @ISA = ('Foswiki::DBI::Schema');
23+
24+
sub getDefinition {
25+
return [[
26+
'CREATE TABLE IF NOT EXISTS %prefix%meta (
27+
id SERIAL,
28+
type VARCHAR(255) NOT NULL,
29+
version INT NOT NULL
30+
) DEFAULT CHARSET=utf8 DEFAULT COLLATE utf8_unicode_ci',
31+
32+
'CREATE UNIQUE INDEX %prefix%idx_meta_type ON %prefix%meta (type)',
33+
]];
34+
}
35+
36+
sub getType { return "db"; }
37+
2338

2439
1;
2540

lib/Foswiki/Plugins/DBIPlugin.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use strict;
1919
use warnings;
2020
use Foswiki::DBI;
2121

22-
our $VERSION = '1.00';
22+
our $VERSION = '1.01';
2323
our $RELEASE = '27 Apr 2022';
2424
our $SHORTDESCRIPTION = 'Database middle layer to manage connections and schemes';
2525
our $NO_PREFS_IN_TOPIC = 1;

0 commit comments

Comments
 (0)