Warning changes for the other schema files

git-svn-id: file:///svn/phpbb/trunk@5646 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Graham Eames 2006-03-17 21:02:32 +00:00
parent fb999487bc
commit f2cc5c093d
5 changed files with 106 additions and 8 deletions

View file

@ -2,7 +2,6 @@
# Firebird Schema for phpBB 3.x - (c) phpBB Group, 2005 # Firebird Schema for phpBB 3.x - (c) phpBB Group, 2005
# #
# $Id$ # $Id$
# @todo user_last_warning to users table and warnings table
# phpbb_attachments # phpbb_attachments
CREATE TABLE phpbb_attachments ( CREATE TABLE phpbb_attachments (
@ -761,6 +760,7 @@ CREATE TABLE phpbb_users (
user_lastpage VARCHAR(100) NOT NULL, user_lastpage VARCHAR(100) NOT NULL,
user_last_confirm_key VARCHAR(10) NOT NULL, user_last_confirm_key VARCHAR(10) NOT NULL,
user_warnings INTEGER DEFAULT 0 NOT NULL, user_warnings INTEGER DEFAULT 0 NOT NULL,
user_last_warning INTEGER DEFAULT 0 NOT NULL,
user_login_attempts INTEGER DEFAULT 0 NOT NULL, user_login_attempts INTEGER DEFAULT 0 NOT NULL,
user_posts INTEGER DEFAULT 0 NOT NULL, user_posts INTEGER DEFAULT 0 NOT NULL,
user_lang VARCHAR(30) NOT NULL, user_lang VARCHAR(30) NOT NULL,
@ -813,6 +813,15 @@ CREATE TABLE phpbb_users (
user_newpasswd VARCHAR(32) NOT NULL user_newpasswd VARCHAR(32) NOT NULL
);; );;
# phpbb_warnings
CREATE TABLE phpbb_warnings (
warning_id INTEGER NOT NULL,
user_id INTEGER DEFAULT 0 NOT NULL,
post_id INTEGER DEFAULT 0 NOT NULL,
log_id INTEGER DEFAULT 0 NOT NULLL,
warning_time INTEGER DEFAULT 0 NOT NULL,
);;
# phpbb_words # phpbb_words
CREATE TABLE phpbb_words ( CREATE TABLE phpbb_words (
word_id INTEGER NOT NULL, word_id INTEGER NOT NULL,
@ -1447,6 +1456,11 @@ ON phpbb_users(
username username
);; );;
ALTER TABLE phpbb_warnings
ADD PRIMARY KEY (
warning_id
);;
ALTER TABLE phpbb_words ALTER TABLE phpbb_words
ADD PRIMARY KEY ( ADD PRIMARY KEY (
word_id word_id
@ -1601,9 +1615,13 @@ CREATE GENERATOR G_phpbb_usersuser_idGen31;;
SET GENERATOR G_phpbb_usersuser_idGen31 TO 0;; SET GENERATOR G_phpbb_usersuser_idGen31 TO 0;;
CREATE GENERATOR G_phpbb_wordsword_idGen32;; CREATE GENERATOR G_phpbb_warningswarning_idGen32;;
SET GENERATOR G_phpbb_wordsword_idGen32 TO 0;; SET GENERATOR G_phpbb_warningswarning_idGen32 TO 0;;
CREATE GENERATOR G_phpbb_wordsword_idGen33;;
SET GENERATOR G_phpbb_wordsword_idGen33 TO 0;;
CREATE TRIGGER tG_phpbb_attachmentsattach_idGe FOR phpbb_attachments CREATE TRIGGER tG_phpbb_attachmentsattach_idGe FOR phpbb_attachments
BEFORE INSERT BEFORE INSERT
@ -1829,9 +1847,16 @@ BEGIN
NEW.user_id = GEN_ID(G_phpbb_usersuser_idGen31, 1); NEW.user_id = GEN_ID(G_phpbb_usersuser_idGen31, 1);
END;; END;;
CREATE TRIGGER GetNextG_phpbb_warningswarning_idGen3 FOR phpbb_warnings
BEFORE INSERT
AS
BEGIN
NEW.warning_id = GEN_ID(G_phpbb_warningswarning_idGen32, 1);
END;;
CREATE TRIGGER GetNextG_phpbb_wordsword_idGen3 FOR phpbb_words CREATE TRIGGER GetNextG_phpbb_wordsword_idGen3 FOR phpbb_words
BEFORE INSERT BEFORE INSERT
AS AS
BEGIN BEGIN
NEW.word_id = GEN_ID(G_phpbb_wordsword_idGen32, 1); NEW.word_id = GEN_ID(G_phpbb_wordsword_idGen33, 1);
END;; END;;

View file

@ -3,7 +3,6 @@
MSSQL Schema for phpBB 3.x - (c) phpBB Group, 2005 MSSQL Schema for phpBB 3.x - (c) phpBB Group, 2005
$Id$ $Id$
@todo user_last_warning to users table and warnings table
*/ */
@ -767,6 +766,7 @@ CREATE TABLE [phpbb_users] (
[user_lastpage] [varchar] (100) NOT NULL , [user_lastpage] [varchar] (100) NOT NULL ,
[user_last_confirm_key] [varchar] (10) NOT NULL , [user_last_confirm_key] [varchar] (10) NOT NULL ,
[user_warnings] [int] NOT NULL , [user_warnings] [int] NOT NULL ,
[user_last_warning] [int] NOT NULL ,
[user_login_attempts] [int] NOT NULL , [user_login_attempts] [int] NOT NULL ,
[user_posts] [int] NOT NULL , [user_posts] [int] NOT NULL ,
[user_lang] [varchar] (30) NOT NULL , [user_lang] [varchar] (30) NOT NULL ,
@ -818,6 +818,15 @@ CREATE TABLE [phpbb_users] (
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO GO
CREATE TABLE [phpbb_warnings] (
[warning_id] [int] IDENTITY (1, 1) NOT NULL ,
[user_id] [int] NOT NULL ,
[post_id] [int] NOT NULL ,
[log_id] [int] NOT NULL ,
[warning_time] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [phpbb_words] ( CREATE TABLE [phpbb_words] (
[word_id] [int] IDENTITY (1, 1) NOT NULL , [word_id] [int] IDENTITY (1, 1) NOT NULL ,
[word] [varchar] (100) NOT NULL , [word] [varchar] (100) NOT NULL ,
@ -1173,6 +1182,13 @@ ALTER TABLE [phpbb_users] WITH NOCHECK ADD
) ON [PRIMARY] ) ON [PRIMARY]
GO GO
ALTER TABLE [phpbb_warnings] WITH NOCHECK ADD
CONSTRAINT [PK_phpbb_warnings] PRIMARY KEY CLUSTERED
(
[warning_id]
) ON [PRIMARY]
GO
ALTER TABLE [phpbb_words] WITH NOCHECK ADD ALTER TABLE [phpbb_words] WITH NOCHECK ADD
CONSTRAINT [PK_phpbb_words] PRIMARY KEY CLUSTERED CONSTRAINT [PK_phpbb_words] PRIMARY KEY CLUSTERED
( (
@ -1613,6 +1629,7 @@ ALTER TABLE [phpbb_users] WITH NOCHECK ADD
CONSTRAINT [DF_users__user_lastmark] DEFAULT (0) FOR [user_lastmark], CONSTRAINT [DF_users__user_lastmark] DEFAULT (0) FOR [user_lastmark],
CONSTRAINT [DF_users__user_lastpost_time] DEFAULT (0) FOR [user_lastpost_time], CONSTRAINT [DF_users__user_lastpost_time] DEFAULT (0) FOR [user_lastpost_time],
CONSTRAINT [DF_users__user_warnings] DEFAULT (0) FOR [user_warnings], CONSTRAINT [DF_users__user_warnings] DEFAULT (0) FOR [user_warnings],
CONSTRAINT [DF_users__user_last_warning] DEFAULT (0) FOR [user_last_warning],
CONSTRAINT [DF_users__user_login_attempts] DEFAULT (0) FOR [user_login_attempts], CONSTRAINT [DF_users__user_login_attempts] DEFAULT (0) FOR [user_login_attempts],
CONSTRAINT [DF_users__user_posts] DEFAULT (0) FOR [user_posts], CONSTRAINT [DF_users__user_posts] DEFAULT (0) FOR [user_posts],
CONSTRAINT [DF_users__user_timezone] DEFAULT (0) FOR [user_timezone], CONSTRAINT [DF_users__user_timezone] DEFAULT (0) FOR [user_timezone],
@ -1647,6 +1664,13 @@ ALTER TABLE [phpbb_users] WITH NOCHECK ADD
CONSTRAINT [DF_users__user_sig_bbcode_bitf] DEFAULT (0) FOR [user_sig_bbcode_bitfield] CONSTRAINT [DF_users__user_sig_bbcode_bitf] DEFAULT (0) FOR [user_sig_bbcode_bitfield]
GO GO
ALTER TABLE [phpbb_warnings] WITH NOCHECK ADD
CONSTRAINT [DF_warnings__user_id] DEFAULT (0) FOR [user_id],
CONSTRAINT [DF_warnings__post_id] DEFAULT (0) FOR [post_id],
CONSTRAINT [DF_warnings__log_id] DEFAULT (0) FOR [log_id],
CONSTRAINT [DF_warnings__warning_time] DEFAULT (0) FOR [warning_time]
GO
ALTER TABLE [phpbb_zebra] WITH NOCHECK ADD ALTER TABLE [phpbb_zebra] WITH NOCHECK ADD
CONSTRAINT [DF_zebra__user_id] DEFAULT (0) FOR [user_id], CONSTRAINT [DF_zebra__user_id] DEFAULT (0) FOR [user_id],
CONSTRAINT [DF_zebra__zebra_id] DEFAULT (0) FOR [zebra_id], CONSTRAINT [DF_zebra__zebra_id] DEFAULT (0) FOR [zebra_id],

View file

@ -2,7 +2,6 @@
Oracle Schema for phpBB 3.x - (c) phpBB Group, 2005 Oracle Schema for phpBB 3.x - (c) phpBB Group, 2005
$Id$ $Id$
@todo user_last_warning to users table and warnings table
*/ */
/* /*
@ -1667,6 +1666,7 @@ CREATE TABLE phpbb_users (
user_lastpage varchar2(100) DEFAULT '', user_lastpage varchar2(100) DEFAULT '',
user_last_confirm_key varchar2(10) DEFAULT '', user_last_confirm_key varchar2(10) DEFAULT '',
user_warnings number(4) DEFAULT '0' NOT NULL, user_warnings number(4) DEFAULT '0' NOT NULL,
user_last_warning number(11) DEFAULT '0' NOT NULL,
user_login_attempts number(4) DEFAULT '0' NOT NULL, user_login_attempts number(4) DEFAULT '0' NOT NULL,
user_posts number(8) DEFAULT '0' NOT NULL, user_posts number(8) DEFAULT '0' NOT NULL,
user_lang varchar2(30) DEFAULT '', user_lang varchar2(30) DEFAULT '',
@ -1741,6 +1741,34 @@ CREATE INDEX user_email_hash on phpbb_users (user_email_hash)
CREATE INDEX username on phpbb_users (username) CREATE INDEX username on phpbb_users (username)
/ /
/*
Table: phpbb_warnings
*/
CREATE TABLE phpbb_warnings (
warning_id number(8) NOT NULL,
user_id number(8) DEFAULT '0' NOT NULL,
post_id number(8) DEFAULT '0' NOT NULL,
log_id number(8) DEFAULT '0' NOT NULL,
warning_time number(11) DEFAULT '0' NOT NULL
CONSTRAINT pk_phpbb_warnings PRIMARY KEY (warning_id)
)
/
CREATE SEQUENCE sq_phpbb_warnings_warning_id
/
CREATE OR REPLACE TRIGGER ai_phpbb_warnings_warning_id
BEFORE INSERT ON phpbb_warnings
FOR EACH ROW WHEN (
new.warning_id IS NULL OR new.warning_id = 0
)
BEGIN
SELECT sq_phpbb_warnings_warning_id.nextval
INTO :new.warning_id
FROM dual;
END;
/
/* /*
Table: phpbb_words Table: phpbb_words
*/ */

View file

@ -2,7 +2,6 @@
PostgreSQL Schema for phpBB 3.x - (c) phpBB Group, 2005 PostgreSQL Schema for phpBB 3.x - (c) phpBB Group, 2005
$Id$ $Id$
@todo user_last_warning to users table and warnings table
*/ */
BEGIN; BEGIN;
@ -1170,6 +1169,7 @@ CREATE TABLE phpbb_users (
user_lastpage varchar(100) DEFAULT '' NOT NULL, user_lastpage varchar(100) DEFAULT '' NOT NULL,
user_last_confirm_key varchar(10) DEFAULT '' NOT NULL, user_last_confirm_key varchar(10) DEFAULT '' NOT NULL,
user_warnings INT2 DEFAULT '0' NOT NULL, user_warnings INT2 DEFAULT '0' NOT NULL,
user_last_warning INT4 DEFAULT '0' NOT NULL,
user_login_attempts INT4 DEFAULT '0' NOT NULL, user_login_attempts INT4 DEFAULT '0' NOT NULL,
user_posts INT4 DEFAULT '0' NOT NULL, user_posts INT4 DEFAULT '0' NOT NULL,
user_lang varchar(30) DEFAULT '' NOT NULL, user_lang varchar(30) DEFAULT '' NOT NULL,
@ -1235,6 +1235,18 @@ CREATE INDEX username_phpbb_users_index ON phpbb_users (username);
SELECT SETVAL('phpbb_users_user_id_seq',(select case when max(user_id)>0 then max(user_id)+1 else 1 end from phpbb_users)); SELECT SETVAL('phpbb_users_user_id_seq',(select case when max(user_id)>0 then max(user_id)+1 else 1 end from phpbb_users));
/* Table: phpbb_warnings */
CREATE SEQUENCE phpbb_warnings_warning_id_seq;
CREATE TABLE phpbb_warnings (
warning_id INT4 DEFAULT nextval('phpbb_warnings_warning_id_seq'),
user_id INT4 DEFAULT '0' NOT NULL,
post_id INT4 DEFAULT '0' NOT NULL,
log_id INT4 DEFAULT '0' NOT NULL,
warning_time INT4 DEFAULT '0' NOT NULL,
PRIMARY KEY (warning_id)
);
/* Table: phpbb_words */ /* Table: phpbb_words */
CREATE SEQUENCE phpbb_words_word_id_seq; CREATE SEQUENCE phpbb_words_word_id_seq;

View file

@ -2,7 +2,6 @@
# SQLite Schema for phpBB 3.x - (c) phpBB Group, 2005 # SQLite Schema for phpBB 3.x - (c) phpBB Group, 2005
# #
# $Id$ # $Id$
# @todo user_last_warning to users table and warnings table
# #
BEGIN TRANSACTION; BEGIN TRANSACTION;
@ -889,6 +888,7 @@ CREATE TABLE phpbb_users (
user_lastpage varchar(100) NOT NULL DEFAULT '', user_lastpage varchar(100) NOT NULL DEFAULT '',
user_last_confirm_key varchar(10) NOT NULL DEFAULT '', user_last_confirm_key varchar(10) NOT NULL DEFAULT '',
user_warnings tinyint(4) NOT NULL DEFAULT '0', user_warnings tinyint(4) NOT NULL DEFAULT '0',
user_last_warning int(11) NOT NULL DEFAULT '0',
user_login_attempts smallint(4) NOT NULL DEFAULT '0', user_login_attempts smallint(4) NOT NULL DEFAULT '0',
user_posts mediumint(8) NOT NULL DEFAULT '0', user_posts mediumint(8) NOT NULL DEFAULT '0',
user_lang varchar(30) NOT NULL DEFAULT '', user_lang varchar(30) NOT NULL DEFAULT '',
@ -943,6 +943,15 @@ CREATE INDEX user_birthday_phpbb_users on phpbb_users (user_birthday);
CREATE INDEX user_email_hash_phpbb_users on phpbb_users (user_email_hash); CREATE INDEX user_email_hash_phpbb_users on phpbb_users (user_email_hash);
CREATE INDEX username_phpbb_users on phpbb_users (username); CREATE INDEX username_phpbb_users on phpbb_users (username);
# Table: phpbb_warnings
CREATE TABLE phpbb_warnings (
warning_id INTEGER PRIMARY KEY NOT NULL,
user_id mediumint(8) NOT NULL DEFAULT '0',
post_id mediumint(8) NOT NULL DEFAULT '0',
log_id mediumint(8) NOT NULL DEFAULT '0',
warning_time int(11) NOT NULL DEFAULT '0'
);
# Table: phpbb_words # Table: phpbb_words
CREATE TABLE phpbb_words ( CREATE TABLE phpbb_words (
word_id INTEGER PRIMARY KEY NOT NULL, word_id INTEGER PRIMARY KEY NOT NULL,