1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/11413] Schema changes and migration file

Notifications tables are dropped because phpBB currently does not have
any way to make the necessary changes to the DB schema (and no release
has yet been made with these changes).

This will fix the following bugs:
PHPBB3-11411
PHPBB3-11413
PHPBB3-11414
PHPBB3-11416
PHPBB3-11420

PHPBB3-11413
This commit is contained in:
Nathaniel Guse
2013-04-28 22:53:05 -05:00
parent c182ab0e7b
commit 198b992dce
10 changed files with 304 additions and 115 deletions

View File

@@ -870,19 +870,37 @@ END;
Table: 'phpbb_notification_types'
*/
CREATE TABLE phpbb_notification_types (
notification_type varchar2(255) DEFAULT '' ,
notification_type_id number(4) NOT NULL,
notification_type_name varchar2(255) DEFAULT '' ,
notification_type_enabled number(1) DEFAULT '1' NOT NULL,
CONSTRAINT pk_phpbb_notification_types PRIMARY KEY (notification_type, notification_type_enabled)
CONSTRAINT pk_phpbb_notification_types PRIMARY KEY (notification_type_id),
CONSTRAINT u_phpbb_type UNIQUE (notification_type_name)
)
/
CREATE SEQUENCE phpbb_notification_types_seq
/
CREATE OR REPLACE TRIGGER t_phpbb_notification_types
BEFORE INSERT ON phpbb_notification_types
FOR EACH ROW WHEN (
new.notification_type_id IS NULL OR new.notification_type_id = 0
)
BEGIN
SELECT phpbb_notification_types_seq.nextval
INTO :new.notification_type_id
FROM dual;
END;
/
/*
Table: 'phpbb_notifications'
*/
CREATE TABLE phpbb_notifications (
notification_id number(8) NOT NULL,
item_type varchar2(255) DEFAULT '' ,
notification_id number(10) NOT NULL,
notification_type_id number(4) DEFAULT '0' NOT NULL,
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,
@@ -893,7 +911,7 @@ CREATE TABLE phpbb_notifications (
)
/
CREATE INDEX phpbb_notifications_item_ident ON phpbb_notifications (item_type, item_id)
CREATE INDEX phpbb_notifications_item_ident ON phpbb_notifications (notification_type_id, item_id)
/
CREATE INDEX phpbb_notifications_user ON phpbb_notifications (user_id, notification_read)
/
@@ -1702,7 +1720,7 @@ 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 '' ,
notification_type_id number(4) DEFAULT '0' NOT NULL,
item_id number(8) DEFAULT '0' NOT NULL,
user_id number(8) DEFAULT '0' NOT NULL,
method varchar2(255) DEFAULT '' ,