diff options
Diffstat (limited to 'install')
-rw-r--r-- | install/schema_mysql.sql | 22 | ||||
-rw-r--r-- | install/schema_postgres.sql | 10 |
2 files changed, 26 insertions, 6 deletions
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 36cd2539b..0d098d661 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -657,17 +657,15 @@ CREATE TABLE IF NOT EXISTS `item` ( KEY `uid_item_wall` (`uid`, `item_wall`), KEY `uid_item_starred` (`uid`, `item_starred`), KEY `uid_item_retained` (`uid`, `item_retained`), - KEY `aid` (`aid`), + KEY `uid_item_private` (`uid`, `item_private`), + KEY `uid_resource_type` (`uid`, `resource_type`), KEY `owner_xchan` (`owner_xchan`), KEY `author_xchan` (`author_xchan`), KEY `resource_id` (`resource_id`), KEY `resource_type` (`resource_type`), - KEY `item_restrict` (`item_restrict`), - KEY `item_flags` (`item_flags`), KEY `commented` (`commented`), KEY `verb` (`verb`), KEY `obj_type` (`obj_type`), - KEY `item_private` (`item_private`), KEY `llink` (`llink`), KEY `expires` (`expires`), KEY `revision` (`revision`), @@ -681,6 +679,7 @@ CREATE TABLE IF NOT EXISTS `item` ( KEY `comments_closed` (`comments_closed`), KEY `changed` (`changed`), KEY `item_origin` (`item_origin`), + KEY `item_wall` (`item_wall`), KEY `item_unseen` (`item_unseen`), KEY `item_uplink` (`item_uplink`), KEY `item_notshown` (`item_notshown`), @@ -692,7 +691,8 @@ CREATE TABLE IF NOT EXISTS `item` ( KEY `item_verified` (`item_verified`), KEY `item_rss` (`item_rss`), KEY `item_consensus` (`item_consensus`), - KEY `item_deleted_pending_remove_changed` (`item_deleted`, `item_pending_remove`, `changed`) + KEY `item_deleted_pending_remove_changed` (`item_deleted`, `item_pending_remove`, `changed`), + KEY `item_pending_remove_changed` (`item_pending_remove`, `changed`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `item_id` ( @@ -964,25 +964,33 @@ CREATE TABLE IF NOT EXISTS `photo` ( CREATE TABLE IF NOT EXISTS `poll` ( `poll_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `poll_guid` varchar(191) NOT NULL, `poll_channel` int(10) unsigned NOT NULL DEFAULT 0 , + `poll_author` varchar(191) NOT NULL, `poll_desc` text NOT NULL, `poll_flags` int(11) NOT NULL DEFAULT 0 , `poll_votes` int(11) NOT NULL DEFAULT 0 , PRIMARY KEY (`poll_id`), + KEY `poll_guid` (`poll_guid`), KEY `poll_channel` (`poll_channel`), + KEY `poll_author` (`poll_author`), KEY `poll_flags` (`poll_flags`), KEY `poll_votes` (`poll_votes`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `poll_elm` ( `pelm_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `pelm_guid` varchar(191) NOT NULL, `pelm_poll` int(10) unsigned NOT NULL DEFAULT 0 , `pelm_desc` text NOT NULL, `pelm_flags` int(11) NOT NULL DEFAULT 0 , `pelm_result` float NOT NULL DEFAULT 0 , + `pelm_order` int(11) NOT NULL DEFAULT 0 , PRIMARY KEY (`pelm_id`), + KEY `pelm_guid` (`pelm_guid`), KEY `pelm_poll` (`pelm_poll`), - KEY `pelm_result` (`pelm_result`) + KEY `pelm_result` (`pelm_result`), + KEY `pelm_order` (`pelm_order`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `profdef` ( @@ -1258,12 +1266,14 @@ CREATE TABLE IF NOT EXISTS `verify` ( CREATE TABLE IF NOT EXISTS `vote` ( `vote_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `vote_guid` varchar(191) NOT NULL, `vote_poll` int(11) NOT NULL DEFAULT 0 , `vote_element` int(11) NOT NULL DEFAULT 0 , `vote_result` text NOT NULL, `vote_xchan` char(191) NOT NULL DEFAULT '', PRIMARY KEY (`vote_id`), UNIQUE KEY `vote_vote` (`vote_poll`,`vote_element`,`vote_xchan`), + KEY `vote_guid` (`vote_guid`), KEY `vote_poll` (`vote_poll`), KEY `vote_element` (`vote_element`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 082817a60..a4f6e9253 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -942,26 +942,34 @@ create index "photo_os_storage" on photo ("os_storage"); CREATE TABLE "poll" ( "poll_id" serial NOT NULL, + "poll_guid" text NOT NULL, "poll_channel" bigint NOT NULL DEFAULT '0', + "poll_author" text NOT NULL, "poll_desc" text NOT NULL, "poll_flags" bigint NOT NULL DEFAULT '0', "poll_votes" bigint NOT NULL DEFAULT '0', PRIMARY KEY ("poll_id") ); +create index "poll_guid" on poll ("poll_guid"); create index "poll_channel" on poll ("poll_channel"); +create index "poll_author" on poll ("poll_author"); create index "poll_flags" on poll ("poll_flags"); create index "poll_votes" on poll ("poll_votes"); CREATE TABLE "poll_elm" ( "pelm_id" serial NOT NULL, + "pelm_guid" text NOT NULL, "pelm_poll" bigint NOT NULL DEFAULT '0', "pelm_desc" text NOT NULL, "pelm_flags" bigint NOT NULL DEFAULT '0', "pelm_result" float NOT NULL DEFAULT '0', + "pelm_order" numeric(6) NOT NULL DEFAULT '0', PRIMARY KEY ("pelm_id") ); +create index "pelm_guid" on poll_elm ("pelm_guid"); create index "pelm_poll" on poll_elm ("pelm_poll"); create index "pelm_result" on poll_elm ("pelm_result"); +create index "pelm_order" on poll_elm ("pelm_order"); CREATE TABLE "profdef" ( "id" serial NOT NULL, @@ -1227,6 +1235,7 @@ create index "verify_meta" on verify ("meta"); create index "verify_created" on verify ("created"); CREATE TABLE "vote" ( "vote_id" serial NOT NULL, + "vote_guid" text NOT NULL, "vote_poll" bigint NOT NULL DEFAULT '0', "vote_element" bigint NOT NULL DEFAULT '0', "vote_result" text NOT NULL, @@ -1234,6 +1243,7 @@ CREATE TABLE "vote" ( PRIMARY KEY ("vote_id"), UNIQUE ("vote_poll","vote_element","vote_xchan") ); +create index "vote_guid" on vote ("vote_guid"); create index "vote_poll" on vote ("vote_poll"); create index "vote_element" on vote ("vote_element"); CREATE TABLE "xchan" ( |