mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AJAXPoll
synced 2024-11-27 08:20:06 +00:00
PostgreSQL support
Bug: T87542 Change-Id: I1089667c7228412fcb8f98702a8bad19abe76aa1
This commit is contained in:
parent
fc458eee43
commit
525a37a284
|
@ -597,6 +597,9 @@ During the last 48 hours, $tab2[0] votes have been given.";
|
||||||
$db = $updater->getDB();
|
$db = $updater->getDB();
|
||||||
|
|
||||||
$patchPath = __DIR__ . '/../sql/';
|
$patchPath = __DIR__ . '/../sql/';
|
||||||
|
if ( $db->getType() == 'postgres' ) {
|
||||||
|
$patchPath .= 'postgres/';
|
||||||
|
}
|
||||||
|
|
||||||
if ( $db->tableExists( 'poll_info' ) ) {
|
if ( $db->tableExists( 'poll_info' ) ) {
|
||||||
# poll_info.poll_title field was dropped in AJAXPoll version 1.72
|
# poll_info.poll_title field was dropped in AJAXPoll version 1.72
|
||||||
|
|
6
sql/postgres/create-table--ajaxpoll_info.sql
Normal file
6
sql/postgres/create-table--ajaxpoll_info.sql
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
CREATE TABLE IF NOT EXISTS ajaxpoll_info (
|
||||||
|
poll_id TEXT NOT NULL PRIMARY KEY default '',
|
||||||
|
poll_txt TEXT,
|
||||||
|
poll_show_results_before_voting SMALLINT,
|
||||||
|
poll_date TIMESTAMPTZ default NULL
|
||||||
|
);
|
15
sql/postgres/create-table--ajaxpoll_vote.sql
Normal file
15
sql/postgres/create-table--ajaxpoll_vote.sql
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
DROP SEQUENCE IF EXISTS ajaxpoll_vote_poll_vote_id_seq CASCADE;
|
||||||
|
CREATE SEQUENCE ajaxpoll_vote_poll_vote_id_seq;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS ajaxpoll_vote (
|
||||||
|
poll_vote_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('ajaxpoll_vote_poll_vote_id_seq'),
|
||||||
|
poll_id TEXT NOT NULL default '',
|
||||||
|
poll_actor INTEGER NOT NULL,
|
||||||
|
poll_ip TEXT default NULL,
|
||||||
|
poll_answer SMALLINT default NULL,
|
||||||
|
poll_date TIMESTAMPTZ default NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
ALTER SEQUENCE ajaxpoll_vote_poll_vote_id_seq OWNED BY ajaxpoll_vote.poll_vote_id;
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX poll_id_actor ON ajaxpoll_vote (poll_id, poll_actor);
|
Loading…
Reference in a new issue