diff options
Diffstat (limited to 'phpBB/install')
-rw-r--r-- | phpBB/install/database_update.php | 114 | ||||
-rw-r--r-- | phpBB/install/schemas/firebird_schema.sql | 48 | ||||
-rw-r--r-- | phpBB/install/schemas/mssql_schema.sql | 66 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_40_schema.sql | 33 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_41_schema.sql | 33 | ||||
-rw-r--r-- | phpBB/install/schemas/oracle_schema.sql | 60 | ||||
-rw-r--r-- | phpBB/install/schemas/postgres_schema.sql | 39 | ||||
-rw-r--r-- | phpBB/install/schemas/schema_data.sql | 7 | ||||
-rw-r--r-- | phpBB/install/schemas/sqlite_schema.sql | 34 |
9 files changed, 423 insertions, 11 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 30592b995d..a4739b7212 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1108,6 +1108,39 @@ function database_update_info() 'ext_name' => array('UNIQUE', 'ext_name'), ), ), + $table_prefix . 'notifications' => array( + 'COLUMNS' => array( + 'notification_id' => array('UINT', NULL, 'auto_increment'), + 'item_type' => array('VCHAR:255', ''), + 'item_id' => array('UINT', 0), + 'item_parent_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'unread' => array('BOOL', 1), + 'is_enabled' => array('BOOL', 1), + 'time' => array('TIMESTAMP', 1), + 'data' => array('TEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'notification_id', + 'KEYS' => array( + 'item_ident' => array('INDEX', array('item_type', 'item_id')), + 'user' => array('INDEX', array('user_id', 'unread')), + ), + ), + $table_prefix . 'user_notifications' => array( + 'COLUMNS' => array( + 'item_type' => array('VCHAR:255', ''), + 'item_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'method' => array('VCHAR:255', ''), + 'notify' => array('BOOL', 1), + ), + 'PRIMARY_KEY' => array( + 'item_type', + 'item_id', + 'user_id', + 'method', + ), + ), ), 'add_columns' => array( GROUPS_TABLE => array( @@ -2496,6 +2529,20 @@ function change_database_data(&$no_updates, $version) 'auth' => '', 'cat' => 'UCP_PROFILE', ), + 'notification_options' => array( + 'base' => 'ucp_notifications', + 'class' => 'ucp', + 'title' => 'UCP_NOTIFICATION_OPTIONS', + 'auth' => '', + 'cat' => 'UCP_PREFS', + ), + 'notification_list' => array( + 'base' => 'ucp_notifications', + 'class' => 'ucp', + 'title' => 'UCP_NOTIFICATION_LIST', + 'auth' => '', + 'cat' => 'UCP_MAIN', + ), ); _add_modules($modules_to_install); @@ -2768,6 +2815,72 @@ function change_database_data(&$no_updates, $version) $config->set('site_home_text', ''); } + if (!isset($config['load_notifications'])) + { + $config->set('load_notifications', 1); + + // Convert notifications + $convert_notifications = array( + array( + 'check' => ($config['allow_topic_notify']), + 'item_type' => 'post', + ), + array( + 'check' => ($config['allow_forum_notify']), + 'item_type' => 'topic', + ), + array( + 'check' => ($config['allow_bookmarks']), + 'item_type' => 'bookmark', + ), + array( + 'check' => ($config['allow_privmsg']), + 'item_type' => 'pm', + ), + ); + + foreach ($convert_notifications as $convert_data) + { + if ($convert_data['check']) + { + $sql = 'SELECT user_id, user_notify_type + FROM ' . USERS_TABLE . ' + WHERE user_notify = 1'; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + _sql('INSERT INTO ' . $table_prefix . 'user_notifications ' . $db->sql_build_array('INSERT', array( + 'item_type' => $convert_data['item_type'], + 'item_id' => 0, + 'user_id' => $row['user_id'], + 'method' => '', + )), $errored, $error_ary); + + if ($row['user_notify_type'] == NOTIFY_EMAIL || $row['user_notify_type'] == NOTIFY_BOTH) + { + _sql('INSERT INTO ' . $table_prefix . 'user_notifications ' . $db->sql_build_array('INSERT', array( + 'item_type' => $convert_data['item_type'], + 'item_id' => 0, + 'user_id' => $row['user_id'], + 'method' => 'email', + )), $errored, $error_ary); + } + + if ($row['user_notify_type'] == NOTIFY_IM || $row['user_notify_type'] == NOTIFY_BOTH) + { + _sql('INSERT INTO ' . $table_prefix . 'user_notifications ' . $db->sql_build_array('INSERT', array( + 'item_type' => $convert_data['item_type'], + 'item_id' => 0, + 'user_id' => $row['user_id'], + 'method' => 'jabber', + )), $errored, $error_ary); + } + } + $db->sql_freeresult($result); + } + } + } + // PHPBB3-10601: Make inbox default. Add basename to ucp's pm category // Get the category wanted while checking, at the same time, if this has already been applied @@ -2839,7 +2952,6 @@ function change_database_data(&$no_updates, $version) _sql($sql, $errored, $error_ary); $no_updates = false; - break; } } diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 767ce68b4a..d3058fb0dd 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -618,6 +618,35 @@ BEGIN END;; +# Table: 'phpbb_notifications' +CREATE TABLE phpbb_notifications ( + notification_id INTEGER NOT NULL, + item_type VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + item_id INTEGER DEFAULT 0 NOT NULL, + item_parent_id INTEGER DEFAULT 0 NOT NULL, + user_id INTEGER DEFAULT 0 NOT NULL, + unread INTEGER DEFAULT 1 NOT NULL, + is_enabled INTEGER DEFAULT 1 NOT NULL, + time INTEGER DEFAULT 1 NOT NULL, + data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL +);; + +ALTER TABLE phpbb_notifications ADD PRIMARY KEY (notification_id);; + +CREATE INDEX phpbb_notifications_item_ident ON phpbb_notifications(item_type, item_id);; +CREATE INDEX phpbb_notifications_user ON phpbb_notifications(user_id, unread);; + +CREATE GENERATOR phpbb_notifications_gen;; +SET GENERATOR phpbb_notifications_gen TO 0;; + +CREATE TRIGGER t_phpbb_notifications FOR phpbb_notifications +BEFORE INSERT +AS +BEGIN + NEW.notification_id = GEN_ID(phpbb_notifications_gen, 1); +END;; + + # Table: 'phpbb_poll_options' CREATE TABLE phpbb_poll_options ( poll_option_id INTEGER DEFAULT 0 NOT NULL, @@ -912,8 +941,8 @@ CREATE TABLE phpbb_reports ( report_time INTEGER DEFAULT 0 NOT NULL, report_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, reported_post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - reported_post_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - reported_post_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL + reported_post_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL, + reported_post_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL );; ALTER TABLE phpbb_reports ADD PRIMARY KEY (report_id);; @@ -1203,6 +1232,21 @@ CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch(topic_id);; CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch(user_id);; CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch(notify_status);; +# Table: 'phpbb_user_notifications' +CREATE TABLE phpbb_user_notifications ( + item_type VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + item_id INTEGER DEFAULT 0 NOT NULL, + user_id INTEGER DEFAULT 0 NOT NULL, + method VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + notify INTEGER DEFAULT 1 NOT NULL +);; + +ALTER TABLE phpbb_user_notifications ADD PRIMARY KEY (item_type, item_id, user_id, method);; + +CREATE INDEX phpbb_user_notifications_it ON phpbb_user_notifications(item_type);; +CREATE INDEX phpbb_user_notifications_uid ON phpbb_user_notifications(user_id);; +CREATE INDEX phpbb_user_notifications_no ON phpbb_user_notifications(notify);; + # Table: 'phpbb_user_group' CREATE TABLE phpbb_user_group ( group_id INTEGER DEFAULT 0 NOT NULL, diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 84c975942f..377ff92620 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -752,6 +752,36 @@ GO /* + Table: 'phpbb_notifications' +*/ +CREATE TABLE [phpbb_notifications] ( + [notification_id] [int] IDENTITY (1, 1) NOT NULL , + [item_type] [varchar] (255) DEFAULT ('') NOT NULL , + [item_id] [int] DEFAULT (0) NOT NULL , + [item_parent_id] [int] DEFAULT (0) NOT NULL , + [user_id] [int] DEFAULT (0) NOT NULL , + [unread] [int] DEFAULT (1) NOT NULL , + [is_enabled] [int] DEFAULT (1) NOT NULL , + [time] [int] DEFAULT (1) NOT NULL , + [data] [varchar] (4000) DEFAULT ('') NOT NULL +) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_notifications] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_notifications] PRIMARY KEY CLUSTERED + ( + [notification_id] + ) ON [PRIMARY] +GO + +CREATE INDEX [item_ident] ON [phpbb_notifications]([item_type], [item_id]) ON [PRIMARY] +GO + +CREATE INDEX [user] ON [phpbb_notifications]([user_id], [unread]) ON [PRIMARY] +GO + + +/* Table: 'phpbb_poll_options' */ CREATE TABLE [phpbb_poll_options] ( @@ -1111,8 +1141,8 @@ CREATE TABLE [phpbb_reports] ( [report_time] [int] DEFAULT (0) NOT NULL , [report_text] [text] DEFAULT ('') NOT NULL , [reported_post_text] [text] DEFAULT ('') NOT NULL , - [reported_post_bitfield] [varchar] (255) DEFAULT ('') NOT NULL , - [reported_post_uid] [varchar] (8) DEFAULT ('') NOT NULL + [reported_post_uid] [varchar] (8) DEFAULT ('') NOT NULL , + [reported_post_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO @@ -1477,6 +1507,38 @@ GO /* + Table: 'phpbb_user_notifications' +*/ +CREATE TABLE [phpbb_user_notifications] ( + [item_type] [varchar] (255) DEFAULT ('') NOT NULL , + [item_id] [int] DEFAULT (0) NOT NULL , + [user_id] [int] DEFAULT (0) NOT NULL , + [method] [varchar] (255) DEFAULT ('') NOT NULL , + [notify] [int] DEFAULT (1) NOT NULL +) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_user_notifications] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_user_notifications] PRIMARY KEY CLUSTERED + ( + [item_type], + [item_id], + [user_id], + [method] + ) ON [PRIMARY] +GO + +CREATE INDEX [it] ON [phpbb_user_notifications]([item_type]) ON [PRIMARY] +GO + +CREATE INDEX [uid] ON [phpbb_user_notifications]([user_id]) ON [PRIMARY] +GO + +CREATE INDEX [no] ON [phpbb_user_notifications]([notify]) ON [PRIMARY] +GO + + +/* Table: 'phpbb_user_group' */ CREATE TABLE [phpbb_user_group] ( diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index 8aab949103..4ceb664cd3 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -430,6 +430,23 @@ CREATE TABLE phpbb_modules ( ); +# Table: 'phpbb_notifications' +CREATE TABLE phpbb_notifications ( + notification_id mediumint(8) UNSIGNED NOT NULL auto_increment, + item_type varbinary(255) DEFAULT '' NOT NULL, + item_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + item_parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + unread tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + is_enabled tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + time int(11) UNSIGNED DEFAULT '1' NOT NULL, + data blob NOT NULL, + PRIMARY KEY (notification_id), + KEY item_ident (item_type, item_id), + KEY user (user_id, unread) +); + + # Table: 'phpbb_poll_options' CREATE TABLE phpbb_poll_options ( poll_option_id tinyint(4) DEFAULT '0' NOT NULL, @@ -649,8 +666,8 @@ CREATE TABLE phpbb_reports ( report_time int(11) UNSIGNED DEFAULT '0' NOT NULL, report_text mediumblob NOT NULL, reported_post_text mediumblob NOT NULL, - reported_post_bitfield varbinary(255) DEFAULT '' NOT NULL, reported_post_uid varbinary(8) DEFAULT '' NOT NULL, + reported_post_bitfield varbinary(255) DEFAULT '' NOT NULL, PRIMARY KEY (report_id), KEY post_id (post_id), KEY pm_id (pm_id) @@ -851,6 +868,20 @@ CREATE TABLE phpbb_topics_watch ( ); +# Table: 'phpbb_user_notifications' +CREATE TABLE phpbb_user_notifications ( + item_type varbinary(255) DEFAULT '' NOT NULL, + item_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + method varbinary(255) DEFAULT '' NOT NULL, + notify tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + PRIMARY KEY (item_type, item_id, user_id, method), + KEY it (item_type), + KEY uid (user_id), + KEY no (notify) +); + + # Table: 'phpbb_user_group' CREATE TABLE phpbb_user_group ( group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 04aef2844a..423b97567a 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -430,6 +430,23 @@ CREATE TABLE phpbb_modules ( ) CHARACTER SET `utf8` COLLATE `utf8_bin`; +# Table: 'phpbb_notifications' +CREATE TABLE phpbb_notifications ( + notification_id mediumint(8) UNSIGNED NOT NULL auto_increment, + item_type varchar(255) DEFAULT '' NOT NULL, + item_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + item_parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + unread tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + is_enabled tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + time int(11) UNSIGNED DEFAULT '1' NOT NULL, + data text NOT NULL, + PRIMARY KEY (notification_id), + KEY item_ident (item_type, item_id), + KEY user (user_id, unread) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + + # Table: 'phpbb_poll_options' CREATE TABLE phpbb_poll_options ( poll_option_id tinyint(4) DEFAULT '0' NOT NULL, @@ -649,8 +666,8 @@ CREATE TABLE phpbb_reports ( report_time int(11) UNSIGNED DEFAULT '0' NOT NULL, report_text mediumtext NOT NULL, reported_post_text mediumtext NOT NULL, - reported_post_bitfield varchar(255) DEFAULT '' NOT NULL, reported_post_uid varchar(8) DEFAULT '' NOT NULL, + reported_post_bitfield varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (report_id), KEY post_id (post_id), KEY pm_id (pm_id) @@ -851,6 +868,20 @@ CREATE TABLE phpbb_topics_watch ( ) CHARACTER SET `utf8` COLLATE `utf8_bin`; +# Table: 'phpbb_user_notifications' +CREATE TABLE phpbb_user_notifications ( + item_type varchar(255) DEFAULT '' NOT NULL, + item_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + method varchar(255) DEFAULT '' NOT NULL, + notify tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + PRIMARY KEY (item_type, item_id, user_id, method), + KEY it (item_type), + KEY uid (user_id), + KEY no (notify) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + + # Table: 'phpbb_user_group' CREATE TABLE phpbb_user_group ( group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 91f906bc8b..b3ea3c7d5e 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -841,6 +841,44 @@ END; /* + Table: 'phpbb_notifications' +*/ +CREATE TABLE phpbb_notifications ( + notification_id number(8) NOT NULL, + item_type varchar2(255) DEFAULT '' , + item_id number(8) DEFAULT '0' NOT NULL, + item_parent_id number(8) DEFAULT '0' NOT NULL, + user_id number(8) DEFAULT '0' NOT NULL, + unread number(1) DEFAULT '1' NOT NULL, + is_enabled number(1) DEFAULT '1' NOT NULL, + time number(11) DEFAULT '1' NOT NULL, + data clob DEFAULT '' , + CONSTRAINT pk_phpbb_notifications PRIMARY KEY (notification_id) +) +/ + +CREATE INDEX phpbb_notifications_item_ident ON phpbb_notifications (item_type, item_id) +/ +CREATE INDEX phpbb_notifications_user ON phpbb_notifications (user_id, unread) +/ + +CREATE SEQUENCE phpbb_notifications_seq +/ + +CREATE OR REPLACE TRIGGER t_phpbb_notifications +BEFORE INSERT ON phpbb_notifications +FOR EACH ROW WHEN ( + new.notification_id IS NULL OR new.notification_id = 0 +) +BEGIN + SELECT phpbb_notifications_seq.nextval + INTO :new.notification_id + FROM dual; +END; +/ + + +/* Table: 'phpbb_poll_options' */ CREATE TABLE phpbb_poll_options ( @@ -1216,8 +1254,8 @@ CREATE TABLE phpbb_reports ( report_time number(11) DEFAULT '0' NOT NULL, report_text clob DEFAULT '' , reported_post_text clob DEFAULT '' , - reported_post_bitfield varchar2(255) DEFAULT '' , reported_post_uid varchar2(8) DEFAULT '' , + reported_post_bitfield varchar2(255) DEFAULT '' , CONSTRAINT pk_phpbb_reports PRIMARY KEY (report_id) ) / @@ -1592,6 +1630,26 @@ CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch (notify_status / /* + Table: 'phpbb_user_notifications' +*/ +CREATE TABLE phpbb_user_notifications ( + item_type varchar2(255) DEFAULT '' , + item_id number(8) DEFAULT '0' NOT NULL, + user_id number(8) DEFAULT '0' NOT NULL, + method varchar2(255) DEFAULT '' , + notify number(1) DEFAULT '1' NOT NULL, + CONSTRAINT pk_phpbb_user_notifications PRIMARY KEY (item_type, item_id, user_id, method) +) +/ + +CREATE INDEX phpbb_user_notifications_it ON phpbb_user_notifications (item_type) +/ +CREATE INDEX phpbb_user_notifications_uid ON phpbb_user_notifications (user_id) +/ +CREATE INDEX phpbb_user_notifications_no ON phpbb_user_notifications (notify) +/ + +/* Table: 'phpbb_user_group' */ CREATE TABLE phpbb_user_group ( diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 619985e0d6..e43b64468d 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -597,6 +597,27 @@ CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules (module_enabled); CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id); /* + Table: 'phpbb_notifications' +*/ +CREATE SEQUENCE phpbb_notifications_seq; + +CREATE TABLE phpbb_notifications ( + notification_id INT4 DEFAULT nextval('phpbb_notifications_seq'), + item_type varchar(255) DEFAULT '' NOT NULL, + item_id INT4 DEFAULT '0' NOT NULL CHECK (item_id >= 0), + item_parent_id INT4 DEFAULT '0' NOT NULL CHECK (item_parent_id >= 0), + user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), + unread INT2 DEFAULT '1' NOT NULL CHECK (unread >= 0), + is_enabled INT2 DEFAULT '1' NOT NULL CHECK (is_enabled >= 0), + time INT4 DEFAULT '1' NOT NULL CHECK (time >= 0), + data varchar(4000) DEFAULT '' NOT NULL, + PRIMARY KEY (notification_id) +); + +CREATE INDEX phpbb_notifications_item_ident ON phpbb_notifications (item_type, item_id); +CREATE INDEX phpbb_notifications_user ON phpbb_notifications (user_id, unread); + +/* Table: 'phpbb_poll_options' */ CREATE TABLE phpbb_poll_options ( @@ -855,8 +876,8 @@ CREATE TABLE phpbb_reports ( report_time INT4 DEFAULT '0' NOT NULL CHECK (report_time >= 0), report_text TEXT DEFAULT '' NOT NULL, reported_post_text TEXT DEFAULT '' NOT NULL, - reported_post_bitfield varchar(255) DEFAULT '' NOT NULL, reported_post_uid varchar(8) DEFAULT '' NOT NULL, + reported_post_bitfield varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (report_id) ); @@ -1096,6 +1117,22 @@ CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch (user_id); CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch (notify_status); /* + Table: 'phpbb_user_notifications' +*/ +CREATE TABLE phpbb_user_notifications ( + item_type varchar(255) DEFAULT '' NOT NULL, + item_id INT4 DEFAULT '0' NOT NULL CHECK (item_id >= 0), + user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), + method varchar(255) DEFAULT '' NOT NULL, + notify INT2 DEFAULT '1' NOT NULL CHECK (notify >= 0), + PRIMARY KEY (item_type, item_id, user_id, method) +); + +CREATE INDEX phpbb_user_notifications_it ON phpbb_user_notifications (item_type); +CREATE INDEX phpbb_user_notifications_uid ON phpbb_user_notifications (user_id); +CREATE INDEX phpbb_user_notifications_no ON phpbb_user_notifications (notify); + +/* Table: 'phpbb_user_group' */ CREATE TABLE phpbb_user_group ( diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 7c1a7d40f5..d145aa37fc 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -175,6 +175,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jquery_cdn', INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jumpbox', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_moderators', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_notifications', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_guests', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_time', '5'); @@ -770,4 +771,10 @@ INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'mp3'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogg'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogm'); +# User Notification Options (for first user) +INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('phpbb_notification_type_post', 0, 2, ''); +INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('phpbb_notification_type_post', 0, 2, 'phpbb_notification_method_email'); +INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('phpbb_notification_type_topic', 0, 2, ''); +INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('phpbb_notification_type_topic', 0, 2, 'phpbb_notification_method_email'); + # POSTGRES COMMIT # diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 1690a7dcab..e3b556668d 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -417,6 +417,22 @@ CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules (left_id, right_id); CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules (module_enabled); CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id); +# Table: 'phpbb_notifications' +CREATE TABLE phpbb_notifications ( + notification_id INTEGER PRIMARY KEY NOT NULL , + item_type varchar(255) NOT NULL DEFAULT '', + item_id INTEGER UNSIGNED NOT NULL DEFAULT '0', + item_parent_id INTEGER UNSIGNED NOT NULL DEFAULT '0', + user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', + unread INTEGER UNSIGNED NOT NULL DEFAULT '1', + is_enabled INTEGER UNSIGNED NOT NULL DEFAULT '1', + time INTEGER UNSIGNED NOT NULL DEFAULT '1', + data text(65535) NOT NULL DEFAULT '' +); + +CREATE INDEX phpbb_notifications_item_ident ON phpbb_notifications (item_type, item_id); +CREATE INDEX phpbb_notifications_user ON phpbb_notifications (user_id, unread); + # Table: 'phpbb_poll_options' CREATE TABLE phpbb_poll_options ( poll_option_id tinyint(4) NOT NULL DEFAULT '0', @@ -630,8 +646,8 @@ CREATE TABLE phpbb_reports ( report_time INTEGER UNSIGNED NOT NULL DEFAULT '0', report_text mediumtext(16777215) NOT NULL DEFAULT '', reported_post_text mediumtext(16777215) NOT NULL DEFAULT '', - reported_post_bitfield varchar(255) NOT NULL DEFAULT '', - reported_post_uid varchar(8) NOT NULL DEFAULT '' + reported_post_uid varchar(8) NOT NULL DEFAULT '', + reported_post_bitfield varchar(255) NOT NULL DEFAULT '' ); CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id); @@ -825,6 +841,20 @@ CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch (topic_id); CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch (user_id); CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch (notify_status); +# Table: 'phpbb_user_notifications' +CREATE TABLE phpbb_user_notifications ( + item_type varchar(255) NOT NULL DEFAULT '', + item_id INTEGER UNSIGNED NOT NULL DEFAULT '0', + user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', + method varchar(255) NOT NULL DEFAULT '', + notify INTEGER UNSIGNED NOT NULL DEFAULT '1', + PRIMARY KEY (item_type, item_id, user_id, method) +); + +CREATE INDEX phpbb_user_notifications_it ON phpbb_user_notifications (item_type); +CREATE INDEX phpbb_user_notifications_uid ON phpbb_user_notifications (user_id); +CREATE INDEX phpbb_user_notifications_no ON phpbb_user_notifications (notify); + # Table: 'phpbb_user_group' CREATE TABLE phpbb_user_group ( group_id INTEGER UNSIGNED NOT NULL DEFAULT '0', |