{"id":297,"date":"2004-11-16T13:27:52","date_gmt":"2004-11-16T03:27:52","guid":{"rendered":"http:\/\/www.flamingspork.com\/blog\/?p=297"},"modified":"2004-11-16T13:27:52","modified_gmt":"2004-11-16T03:27:52","slug":"implementing-the-nominations-stuff","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2004\/11\/16\/implementing-the-nominations-stuff\/","title":{"rendered":"implementing the nominations stuff"},"content":{"rendered":"<p>previously, we had the idea of an election candidate:<\/p>\n<pre>\r\ncreate table election_candidate (\r\n     id serial unique not null,\r\n     election_position_id int not null,\r\n     approved boolean,\r\n     member_id int not null,\r\n     spiel text,\r\n        CONSTRAINT \"election_candidate_pkey\" PRIMARY KEY (id),\r\n        CONSTRAINT \"election_candidate_election_position_id_fkey\" FOREIGN KEY (org_id) references election_position(id) on update restrict,\r\n      CONSTRAINT \"election_candidate_member_id\" FOREIGN KEY (member-id) references current_memberships(id)\r\n -- FIXME: need constraint that member is a member of the correct org.\r\n );\r\n<\/pre>\n<p>now, that&#8217;s all fine and good&#8230; but we need the whole nominations thing to work.<\/p>\n<p>so what about something like this:<\/p>\n<pre>\r\ncreate table election_candidate_nomination (\r\n     when timestamp not null default now(),\r\n     election_position_id int not null,\r\n     from_member_id int not null, -- member doing the nominating\r\n     for_member_id int not null, -- the member being nominated,\r\n     reason text,\r\n     CONSTRAINT \"nomination_from_member_id_fkey\" FOREIGN KEY (from_member_id) references members(id) on update restrict,\r\n     CONSTRAINT \"nomination_for_member_id_fkey\" FOREIGN KEY (for_member_id) references members(id) on update restrict,\r\n     CONSTRAINT \"election_candidate_election_position_id_fkey\" FOREIGN KEY (org_id) references election_position(id) on update restrict,\r\n\r\n);\r\n<\/pre>\n<p>this should be adequate to keep track of nominations. When enough nominations are gathered and the candidate accepts, then we can create an entry in election_candidate.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>previously, we had the idea of an election candidate: create table election_candidate ( id serial unique not null, election_position_id int not null, approved boolean, member_id int not null, spiel text, CONSTRAINT &#8220;election_candidate_pkey&#8221; PRIMARY KEY (id), CONSTRAINT &#8220;election_candidate_election_position_id_fkey&#8221; FOREIGN KEY (org_id) &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2004\/11\/16\/implementing-the-nominations-stuff\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[6,13],"tags":[],"class_list":["post-297","post","type-post","status-publish","format-standard","hentry","category-linux-aus","category-memberdb"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-4N","jetpack-related-posts":[{"id":261,"url":"https:\/\/www.flamingspork.com\/blog\/2004\/08\/22\/memberdb-voting-code-planning-in-some-sense-of-the-word\/","url_meta":{"origin":297,"position":0},"title":"MemberDB Voting code (planning&#8230; in some sense of the word)","author":"Stewart Smith","date":"2004-08-22","format":false,"excerpt":"well... at some point there has to be some voting code done for MemberDB. Namely because Linux Australia has to have elections sometime early next year, and the code really should work before then! Currently, we can easily work out who is a current member of the organisation. Only current\u2026","rel":"","context":"In &quot;linux-aus&quot;","block_context":{"text":"linux-aus","link":"https:\/\/www.flamingspork.com\/blog\/category\/linux-aus\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1576,"url":"https:\/\/www.flamingspork.com\/blog\/2009\/02\/25\/no-implicit-defaults\/","url_meta":{"origin":297,"position":1},"title":"No implicit defaults","author":"Stewart Smith","date":"2009-02-25","format":false,"excerpt":"See also: MySQL Bug 43151 The MySQL Manual proudly states that you don't get implicit default values if strict mode. mysql> set sql_mode='STRICT_ALL_TABLES'; Query OK, 0 rows affected (0.00 sec) mysql> create table t1 (a int, b int, c int, d int, e int, f int, g int, h int,i\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":578,"url":"https:\/\/www.flamingspork.com\/blog\/2006\/02\/15\/information_schemafiles-querying-disk-usage-from-sql\/","url_meta":{"origin":297,"position":2},"title":"INFORMATION_SCHEMA.FILES (querying disk usage from SQL)","author":"Stewart Smith","date":"2006-02-15","format":false,"excerpt":"In MySQL 5.1.6 there's a new INFORMATION_SCHEMA table. Currently, it only has information on files for NDB but we're hoping to change that in a future release (read: I think it would be neat). This table is a table generated by the MySQL server listing all the different files that\u2026","rel":"","context":"In &quot;mysql&quot;","block_context":{"text":"mysql","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/mysql\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2362,"url":"https:\/\/www.flamingspork.com\/blog\/2011\/04\/21\/http-json-alsosql-interface-to-drizzle\/","url_meta":{"origin":297,"position":3},"title":"HTTP JSON AlsoSQL interface to Drizzle","author":"Stewart Smith","date":"2011-04-21","format":false,"excerpt":"So... I had another one of those \"hrrm... this shouldn't be hard to hack a proof-of-concept\" moments. Web apps are increasingly speaking JSON all around the place. Why can't we speak JSON to\/from the database? Why? Seriously, why not? One reason why MongoDB has found users is that JSON is\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.flamingspork.com\/blog\/wp-content\/uploads\/2011\/04\/Screenshot-11-300x230.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":478,"url":"https:\/\/www.flamingspork.com\/blog\/2005\/10\/03\/a-funky-thing-done-last-week\/","url_meta":{"origin":297,"position":4},"title":"a funky thing done last week&#8230;","author":"Stewart Smith","date":"2005-10-03","format":false,"excerpt":"still have to talk to people about standards for this sort of thing and all that. But as a first checkin - funkyness++! mysql> select * from INFORMATION_SCHEMA.DATAFILES; select * from INFORMATION_SCHEMA.TABLESPACES; Empty set (0.03 sec) Empty set (0.00 sec) mysql> CREATE TABLESPACE ts1 ADD DATAFILE 'datafile.dat' USE LOGFILE GROUP\u2026","rel":"","context":"In &quot;mysql&quot;","block_context":{"text":"mysql","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/mysql\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1876,"url":"https:\/\/www.flamingspork.com\/blog\/2010\/04\/02\/the-drizzle-and-mysql-key-tuple-format\/","url_meta":{"origin":297,"position":5},"title":"The Drizzle (and MySQL) Key tuple format","author":"Stewart Smith","date":"2010-04-02","format":false,"excerpt":"Here's something that's not really documented anywhere (unless you count ha_innodb.cc as a source of server documentation). You may have some idea about the MySQL\/Drizzle row buffer format. This is passed around the storage engine interface: in for write_row and update_row and out for the various scan and index read\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/comments?post=297"}],"version-history":[{"count":1,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/297\/revisions"}],"predecessor-version":[{"id":2812,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/297\/revisions\/2812"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}