From f0f58dade886d88fc178b78c04e1a4067ddfda04 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 6 Mar 2018 15:31:45 -0800 Subject: federated polls: add poll_author which will be necessary for Diaspora federation --- install/schema_mysql.sql | 2 ++ install/schema_postgres.sql | 2 ++ 2 files changed, 4 insertions(+) (limited to 'install') diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 5cd04467d..9d60d9eb2 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -969,12 +969,14 @@ 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; diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 84b6a554a..d8bbd89f4 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -944,6 +944,7 @@ 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', @@ -952,6 +953,7 @@ CREATE TABLE "poll" ( ); 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" ( -- cgit v1.2.3 From a454aad124f999e59e8bffb625c103b975aef107 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 7 Mar 2018 15:39:14 -0800 Subject: federated polls: GNU-Social requires us to preserve the original order of the poll answers for use in making a vote, unlike diaspora (which selects by guid) and activitypub (which selects by non-localisable text). --- install/schema_mysql.sql | 4 +++- install/schema_postgres.sql | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'install') diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 9d60d9eb2..62cf6a5f2 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -988,10 +988,12 @@ CREATE TABLE IF NOT EXISTS `poll_elm` ( `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` ( diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index d8bbd89f4..a4f6e9253 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -963,11 +963,13 @@ CREATE TABLE "poll_elm" ( "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, -- cgit v1.2.3 From 9c02c66ed3838c753f4d50354716abdf0dcc2a6d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 9 Mar 2018 09:17:57 +0100 Subject: remove redundant comma --- install/schema_mysql.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'install') diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 62cf6a5f2..1f396ee0e 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -993,7 +993,7 @@ CREATE TABLE IF NOT EXISTS `poll_elm` ( KEY `pelm_guid` (`pelm_guid`), KEY `pelm_poll` (`pelm_poll`), KEY `pelm_result` (`pelm_result`), - KEY `pelm_order` (`pelm_order`), + KEY `pelm_order` (`pelm_order`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `profdef` ( -- cgit v1.2.3