Here's the SQL patch.
From dc2413b5ef33ced0fe48cabf1f85129b881d8330 Mon Sep 17 00:00:00 2001 From: Sherif Ramadan <google...@php.net> Date: Sun, 9 Sep 2012 14:19:51 -0400 Subject: [PATCH] Updated SQL schema for new user notes features voting/flagging.
--- note.sql | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/note.sql b/note.sql index bf2fc7d..c7b12d8 100644 --- a/note.sql +++ b/note.sql @@ -10,6 +10,8 @@ master.php.net/entry/user-note.php master.php.net/fetch/user-notes.php master.php.net/manage/user-notes.php + master.php.net/entry/user-notes-vote.php + master.php.net/entry/user-notes-flag.php */ CREATE TABLE IF NOT EXISTS note ( @@ -32,3 +34,31 @@ CREATE TABLE IF NOT EXISTS alerts ( sect VARCHAR(80) not NULL default '', updated TIMESTAMP(14) NOT NULL ) TYPE=MyISAM; + +-- New votes table added by Sherif +CREATE TABLE IF NOT EXISTS `votes` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `note_id` mediumint(9) NOT NULL, + `ip` bigint(20) unsigned NOT NULL DEFAULT '0', + `hostip` bigint(20) unsigned NOT NULL DEFAULT '0', + `ts` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `vote` tinyint(1) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `note_id` (`note_id`,`ip`,`vote`), + KEY `hostip` (`hostip`) +) TYPE=MyISAM AUTO_INCREMENT=1; + +-- New flags table added by Sherif +CREATE TABLE IF NOT EXISTS `flags` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `note_id` mediumint(9) NOT NULL, + `ip` bigint(20) unsigned NOT NULL DEFAULT '0', + `hostip` bigint(20) unsigned NOT NULL DEFAULT '0', + `ts` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `flag` varchar(80) NOT NULL DEFAULT '', + `email` varchar(120) NOT NULL DEFAULT '', + `info` text, + PRIMARY KEY (`id`), + KEY `note_id` (`note_id`,`ip`,`flag`), + KEY `hostip` (`hostip`) +) TYPE=MyISAM AUTO_INCREMENT=1; -- 1.7.5.4