diff options
Diffstat (limited to 'phpBB/install')
-rw-r--r-- | phpBB/install/database_update.php | 130 | ||||
-rw-r--r-- | phpBB/install/schemas/firebird_schema.sql | 47 | ||||
-rw-r--r-- | phpBB/install/schemas/mssql_schema.sql | 60 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_40_schema.sql | 34 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_41_schema.sql | 34 | ||||
-rw-r--r-- | phpBB/install/schemas/oracle_schema.sql | 61 | ||||
-rw-r--r-- | phpBB/install/schemas/postgres_schema.sql | 42 | ||||
-rw-r--r-- | phpBB/install/schemas/schema_data.sql | 7 | ||||
-rw-r--r-- | phpBB/install/schemas/sqlite_schema.sql | 33 |
9 files changed, 447 insertions, 1 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 4e17a1429c..45632a0c3a 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -97,6 +97,22 @@ if (!defined('LOGIN_ATTEMPT_TABLE')) { define('LOGIN_ATTEMPT_TABLE', $table_prefix . 'login_attempts'); } +if (!defined('NOTIFICATION_TYPES_TABLE')) +{ + define('NOTIFICATION_TYPES_TABLE', $table_prefix . 'notification_types'); +} +if (!defined('NOTIFICATIONS_TYPES_TABLE')) +{ + define('NOTIFICATIONS_TYPES_TABLE', $table_prefix . 'notifications_types'); +} +if (!defined('NOTIFICATIONS_TABLE')) +{ + define('NOTIFICATIONS_TABLE', $table_prefix . 'notifications'); +} +if (!defined('USER_NOTIFICATIONS_TABLE')) +{ + define('USER_NOTIFICATIONS_TABLE', $table_prefix . 'user_notifications'); +} if (!defined('EXT_TABLE')) { define('EXT_TABLE', $table_prefix . 'ext'); @@ -1165,6 +1181,39 @@ function database_update_info() 'ext_name' => array('UNIQUE', 'ext_name'), ), ), + NOTIFICATION_TYPES_TABLE => array( + 'COLUMNS' => array( + 'notification_type' => array('VCHAR:255', ''), + 'notification_type_enabled' => array('BOOL', 1), + ), + 'PRIMARY_KEY' => array('notification_type', 'notification_type_enabled'), + ), + NOTIFICATIONS_TABLE => 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), + 'notification_read' => array('BOOL', 0), + 'notification_time' => array('TIMESTAMP', 1), + 'notification_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', 'notification_read')), + ), + ), + USER_NOTIFICATIONS_TABLE => 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), + ), + ), ), 'add_columns' => array( GROUPS_TABLE => array( @@ -2575,6 +2624,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', + ), // To add a category, the mode and basename must be empty // The mode is taken from the array key '' => array( @@ -2908,6 +2971,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 @@ -2947,7 +3076,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 c4818215e4..d0f8d8e70f 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -632,6 +632,43 @@ BEGIN END;; +# Table: 'phpbb_notification_types' +CREATE TABLE phpbb_notification_types ( + notification_type VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + notification_type_enabled INTEGER DEFAULT 1 NOT NULL +);; + +ALTER TABLE phpbb_notification_types ADD PRIMARY KEY (notification_type, notification_type_enabled);; + + +# 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, + notification_read INTEGER DEFAULT 0 NOT NULL, + notification_time INTEGER DEFAULT 1 NOT NULL, + notification_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, notification_read);; + +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, @@ -1220,6 +1257,16 @@ 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 +);; + + # 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 709f83917e..3f6c694f32 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -774,6 +774,53 @@ GO /* + Table: 'phpbb_notification_types' +*/ +CREATE TABLE [phpbb_notification_types] ( + [notification_type] [varchar] (255) DEFAULT ('') NOT NULL , + [notification_type_enabled] [int] DEFAULT (1) NOT NULL +) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_notification_types] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_notification_types] PRIMARY KEY CLUSTERED + ( + [notification_type], + [notification_type_enabled] + ) ON [PRIMARY] +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 , + [notification_read] [int] DEFAULT (0) NOT NULL , + [notification_time] [int] DEFAULT (1) NOT NULL , + [notification_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], [notification_read]) ON [PRIMARY] +GO + + +/* Table: 'phpbb_poll_options' */ CREATE TABLE [phpbb_poll_options] ( @@ -1502,6 +1549,19 @@ 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 + + +/* 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 c905dda77e..42196fe8c3 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -443,6 +443,30 @@ CREATE TABLE phpbb_modules ( ); +# Table: 'phpbb_notification_types' +CREATE TABLE phpbb_notification_types ( + notification_type varbinary(255) DEFAULT '' NOT NULL, + notification_type_enabled tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + PRIMARY KEY (notification_type, notification_type_enabled) +); + + +# 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, + notification_read tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + notification_time int(11) UNSIGNED DEFAULT '1' NOT NULL, + notification_data blob NOT NULL, + PRIMARY KEY (notification_id), + KEY item_ident (item_type, item_id), + KEY user (user_id, notification_read) +); + + # Table: 'phpbb_poll_options' CREATE TABLE phpbb_poll_options ( poll_option_id tinyint(4) DEFAULT '0' NOT NULL, @@ -867,6 +891,16 @@ 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 +); + + # 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 b5d7c70c10..c3424bc79b 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -443,6 +443,30 @@ CREATE TABLE phpbb_modules ( ) CHARACTER SET `utf8` COLLATE `utf8_bin`; +# Table: 'phpbb_notification_types' +CREATE TABLE phpbb_notification_types ( + notification_type varchar(255) DEFAULT '' NOT NULL, + notification_type_enabled tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + PRIMARY KEY (notification_type, notification_type_enabled) +) 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, + notification_read tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + notification_time int(11) UNSIGNED DEFAULT '1' NOT NULL, + notification_data text NOT NULL, + PRIMARY KEY (notification_id), + KEY item_ident (item_type, item_id), + KEY user (user_id, notification_read) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + + # Table: 'phpbb_poll_options' CREATE TABLE phpbb_poll_options ( poll_option_id tinyint(4) DEFAULT '0' NOT NULL, @@ -867,6 +891,16 @@ 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 +) 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 e2bdb2385b..5dfb6ee243 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -857,6 +857,54 @@ END; /* + Table: 'phpbb_notification_types' +*/ +CREATE TABLE phpbb_notification_types ( + notification_type varchar2(255) DEFAULT '' , + notification_type_enabled number(1) DEFAULT '1' NOT NULL, + CONSTRAINT pk_phpbb_notification_types PRIMARY KEY (notification_type, notification_type_enabled) +) +/ + + +/* + 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, + notification_read number(1) DEFAULT '0' NOT NULL, + notification_time number(11) DEFAULT '1' NOT NULL, + notification_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, notification_read) +/ + +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 ( @@ -1611,6 +1659,19 @@ 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 +) +/ + + +/* 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 41d510e4c3..07ca7f1e95 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -612,6 +612,36 @@ 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_notification_types' +*/ +CREATE TABLE phpbb_notification_types ( + notification_type varchar(255) DEFAULT '' NOT NULL, + notification_type_enabled INT2 DEFAULT '1' NOT NULL CHECK (notification_type_enabled >= 0), + PRIMARY KEY (notification_type, notification_type_enabled) +); + + +/* + 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), + notification_read INT2 DEFAULT '0' NOT NULL CHECK (notification_read >= 0), + notification_time INT4 DEFAULT '1' NOT NULL CHECK (notification_time >= 0), + notification_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, notification_read); + +/* Table: 'phpbb_poll_options' */ CREATE TABLE phpbb_poll_options ( @@ -1114,6 +1144,18 @@ 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) +); + + +/* 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 fe028bd12c..5274e08cca 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -430,6 +430,29 @@ 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_notification_types' +CREATE TABLE phpbb_notification_types ( + notification_type varchar(255) NOT NULL DEFAULT '', + notification_type_enabled INTEGER UNSIGNED NOT NULL DEFAULT '1', + PRIMARY KEY (notification_type, notification_type_enabled) +); + + +# 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', + notification_read INTEGER UNSIGNED NOT NULL DEFAULT '0', + notification_time INTEGER UNSIGNED NOT NULL DEFAULT '1', + notification_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, notification_read); + # Table: 'phpbb_poll_options' CREATE TABLE phpbb_poll_options ( poll_option_id tinyint(4) NOT NULL DEFAULT '0', @@ -841,6 +864,16 @@ 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' +); + + # Table: 'phpbb_user_group' CREATE TABLE phpbb_user_group ( group_id INTEGER UNSIGNED NOT NULL DEFAULT '0', |