vote/include/schema.sql | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-)
New commits: commit c5e8568a01780ca2ed3106e2508c656312945573 Author: Thorsten Behrens <tbehr...@suse.com> Date: Tue Feb 19 13:36:54 2013 +0100 Make schema actually importable. diff --git a/vote/include/schema.sql b/vote/include/schema.sql index 4388d50..4b756f8 100644 --- a/vote/include/schema.sql +++ b/vote/include/schema.sql @@ -1,15 +1,6 @@ CREATE database elections; - /* this user has elevated rights - not to be used from php */ - CREATE USER 'voting'@'localhost' IDENTIFIED BY 'secure_pw'; - GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON elections.* TO 'voting'@'localhost'; - - /* this user has lowest-possible rights - to be used from php */ - CREATE USER 'web'@'localhost' IDENTIFIED BY 'whatever'; - GRANT SELECT ON elections.* TO 'web'@'localhost'; - GRANT SELECT,INSERT ON elections.election_anon_tokens TO 'web'@'localhost'; - GRANT SELECT,INSERT ON elections.election_votes TO 'web'@'localhost'; - GRANT SELECT,DELETE ON elections.election_tmp_tokens TO 'web'@'localhost'; + use elections; CREATE TABLE `elections` ( `id` int(11) NOT NULL auto_increment, @@ -46,25 +37,36 @@ ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /* -from members database we prepare anon tokens + from members database we prepare anon tokens then insert those anon tokens to database of course before a new election record should be created since its id is needed for anon_tokens and election_choices are to be inserted rest is handled by itself iirc */ -CREATE TABLE `election_votes` ( + CREATE TABLE `election_votes` ( `id` int(11) NOT NULL auto_increment, `choice_id` int(11) NOT NULL default '0', `anon_id` int(11) NOT NULL default '0', `preference` int(11) NOT NULL default '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB; + ) ENGINE=InnoDB; -CREATE TABLE `election_results` ( + CREATE TABLE `election_results` ( `id` int(11) NOT NULL auto_increment, `election_id` int(11) NOT NULL default '0', `result` text NOT NULL, PRIMARY KEY (`id`) -) DEFAULT CHARSET=utf8; + ) DEFAULT CHARSET=utf8; + + /* this user has elevated rights - not to be used from php */ + CREATE USER 'voting'@'localhost' IDENTIFIED BY 'secure_pw'; + GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON elections.* TO 'voting'@'localhost'; + + /* this user has lowest-possible rights - to be used from php */ + CREATE USER 'web'@'localhost' IDENTIFIED BY 'whatever'; + GRANT SELECT ON elections.* TO 'web'@'localhost'; + GRANT SELECT,INSERT ON elections.election_anon_tokens TO 'web'@'localhost'; + GRANT SELECT,INSERT ON elections.election_votes TO 'web'@'localhost'; + GRANT SELECT,DELETE ON elections.election_tmp_tokens TO 'web'@'localhost'; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits