1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

Merge remote-tracking branch 'EXreaction/ticket/11413' into develop

* EXreaction/ticket/11413: (23 commits)
  [ticket/11413] Revert some cache service related changes from earlier
  [ticket/11413] Use phpbb_user in test
  [ticket/11413] $user should have been $this->user
  [ticket/11413] Fix unit tests
  [ticket/11413] Translate the error
  [ticket/11413] Rename file to something more helpful
  [ticket/11413] Remove remaining irrelevant code to this PR
  [ticket/11413] Remove mock sql_insert_buffer.php (not relevant to PR)
  [ticket/11413] Remove conversion of user_notifications
  [ticket/11413] Correct copyright year
  [ticket/11413] Remove changes for ticket 11420 from this branch
  [ticket/11413] Include mock class
  [ticket/11413] Don't use the database for the convert test
  [ticket/11413] Test get_notification_type_id and _ids functions
  [ticket/11413] Use sql_insert_buffer
  [ticket/11413] Create test for notification conversion
  [ticket/11413] Fix test fixtures and tests
  [ticket/11413] Fix some more tests
  [ticket/11413] Fix notification tests
  [ticket/11413] Prevent recursive function calls
  ...
This commit is contained in:
David King
2013-05-20 11:54:39 -04:00
25 changed files with 516 additions and 210 deletions

View File

@@ -642,17 +642,30 @@ END;;
# Table: 'phpbb_notification_types'
CREATE TABLE phpbb_notification_types (
notification_type VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
notification_type_id INTEGER NOT NULL,
notification_type_name 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);;
ALTER TABLE phpbb_notification_types ADD PRIMARY KEY (notification_type_id);;
CREATE UNIQUE INDEX phpbb_notification_types_type ON phpbb_notification_types(notification_type_name);;
CREATE GENERATOR phpbb_notification_types_gen;;
SET GENERATOR phpbb_notification_types_gen TO 0;;
CREATE TRIGGER t_phpbb_notification_types FOR phpbb_notification_types
BEFORE INSERT
AS
BEGIN
NEW.notification_type_id = GEN_ID(phpbb_notification_types_gen, 1);
END;;
# Table: 'phpbb_notifications'
CREATE TABLE phpbb_notifications (
notification_id INTEGER NOT NULL,
item_type VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
notification_type_id INTEGER DEFAULT 0 NOT NULL,
item_id INTEGER DEFAULT 0 NOT NULL,
item_parent_id INTEGER DEFAULT 0 NOT NULL,
user_id INTEGER DEFAULT 0 NOT NULL,
@@ -663,7 +676,7 @@ CREATE TABLE phpbb_notifications (
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_item_ident ON phpbb_notifications(notification_type_id, item_id);;
CREATE INDEX phpbb_notifications_user ON phpbb_notifications(user_id, notification_read);;
CREATE GENERATOR phpbb_notifications_gen;;

View File

@@ -793,7 +793,8 @@ GO
Table: 'phpbb_notification_types'
*/
CREATE TABLE [phpbb_notification_types] (
[notification_type] [varchar] (255) DEFAULT ('') NOT NULL ,
[notification_type_id] [int] IDENTITY (1, 1) NOT NULL ,
[notification_type_name] [varchar] (255) DEFAULT ('') NOT NULL ,
[notification_type_enabled] [int] DEFAULT (1) NOT NULL
) ON [PRIMARY]
GO
@@ -801,18 +802,20 @@ GO
ALTER TABLE [phpbb_notification_types] WITH NOCHECK ADD
CONSTRAINT [PK_phpbb_notification_types] PRIMARY KEY CLUSTERED
(
[notification_type],
[notification_type_enabled]
[notification_type_id]
) ON [PRIMARY]
GO
CREATE UNIQUE INDEX [type] ON [phpbb_notification_types]([notification_type_name]) 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 ,
[notification_type_id] [int] DEFAULT (0) NOT NULL ,
[item_id] [int] DEFAULT (0) NOT NULL ,
[item_parent_id] [int] DEFAULT (0) NOT NULL ,
[user_id] [int] DEFAULT (0) NOT NULL ,
@@ -829,7 +832,7 @@ ALTER TABLE [phpbb_notifications] WITH NOCHECK ADD
) ON [PRIMARY]
GO
CREATE INDEX [item_ident] ON [phpbb_notifications]([item_type], [item_id]) ON [PRIMARY]
CREATE INDEX [item_ident] ON [phpbb_notifications]([notification_type_id], [item_id]) ON [PRIMARY]
GO
CREATE INDEX [user] ON [phpbb_notifications]([user_id], [notification_read]) ON [PRIMARY]

View File

@@ -452,16 +452,18 @@ CREATE TABLE phpbb_modules (
# Table: 'phpbb_notification_types'
CREATE TABLE phpbb_notification_types (
notification_type varbinary(255) DEFAULT '' NOT NULL,
notification_type_id smallint(4) UNSIGNED NOT NULL auto_increment,
notification_type_name varbinary(255) DEFAULT '' NOT NULL,
notification_type_enabled tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
PRIMARY KEY (notification_type, notification_type_enabled)
PRIMARY KEY (notification_type_id),
UNIQUE type (notification_type_name)
);
# Table: 'phpbb_notifications'
CREATE TABLE phpbb_notifications (
notification_id mediumint(8) UNSIGNED NOT NULL auto_increment,
item_type varbinary(255) DEFAULT '' NOT NULL,
notification_id int(10) UNSIGNED NOT NULL auto_increment,
notification_type_id smallint(4) UNSIGNED DEFAULT '0' 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,
@@ -469,7 +471,7 @@ CREATE TABLE phpbb_notifications (
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 item_ident (notification_type_id, item_id),
KEY user (user_id, notification_read)
);

View File

@@ -452,16 +452,18 @@ CREATE TABLE phpbb_modules (
# Table: 'phpbb_notification_types'
CREATE TABLE phpbb_notification_types (
notification_type varchar(255) DEFAULT '' NOT NULL,
notification_type_id smallint(4) UNSIGNED NOT NULL auto_increment,
notification_type_name varchar(255) DEFAULT '' NOT NULL,
notification_type_enabled tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
PRIMARY KEY (notification_type, notification_type_enabled)
PRIMARY KEY (notification_type_id),
UNIQUE type (notification_type_name)
) 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,
notification_id int(10) UNSIGNED NOT NULL auto_increment,
notification_type_id smallint(4) UNSIGNED DEFAULT '0' 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,
@@ -469,7 +471,7 @@ CREATE TABLE phpbb_notifications (
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 item_ident (notification_type_id, item_id),
KEY user (user_id, notification_read)
) CHARACTER SET `utf8` COLLATE `utf8_bin`;

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)
/

View File

@@ -623,12 +623,16 @@ CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id
/*
Table: 'phpbb_notification_types'
*/
CREATE SEQUENCE phpbb_notification_types_seq;
CREATE TABLE phpbb_notification_types (
notification_type varchar(255) DEFAULT '' NOT NULL,
notification_type_id INT2 DEFAULT nextval('phpbb_notification_types_seq'),
notification_type_name 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)
PRIMARY KEY (notification_type_id)
);
CREATE UNIQUE INDEX phpbb_notification_types_type ON phpbb_notification_types (notification_type_name);
/*
Table: 'phpbb_notifications'
@@ -637,7 +641,7 @@ CREATE SEQUENCE phpbb_notifications_seq;
CREATE TABLE phpbb_notifications (
notification_id INT4 DEFAULT nextval('phpbb_notifications_seq'),
item_type varchar(255) DEFAULT '' NOT NULL,
notification_type_id INT2 DEFAULT '0' NOT NULL CHECK (notification_type_id >= 0),
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),
@@ -647,7 +651,7 @@ CREATE TABLE phpbb_notifications (
PRIMARY KEY (notification_id)
);
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);
/*

View File

@@ -439,16 +439,17 @@ 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)
notification_type_id INTEGER PRIMARY KEY NOT NULL ,
notification_type_name varchar(255) NOT NULL DEFAULT '',
notification_type_enabled INTEGER UNSIGNED NOT NULL DEFAULT '1'
);
CREATE UNIQUE INDEX phpbb_notification_types_type ON phpbb_notification_types (notification_type_name);
# Table: 'phpbb_notifications'
CREATE TABLE phpbb_notifications (
notification_id INTEGER PRIMARY KEY NOT NULL ,
item_type varchar(255) NOT NULL DEFAULT '',
notification_type_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
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',
@@ -457,7 +458,7 @@ CREATE TABLE phpbb_notifications (
notification_data text(65535) NOT NULL DEFAULT ''
);
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);
# Table: 'phpbb_poll_options'