From 7fcba7f4a75f67466e61806e12fb1cdc1d3ebdcb Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Mon, 6 Feb 2006 21:32:42 +0000 Subject: [PATCH] Database changes for search flood control AcydBurn - Can you please replicate this into the MS Access primer for me git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@5532 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/schemas/mssql_basic.sql | 3 ++- phpBB/install/schemas/mssql_schema.sql | 5 +++++ phpBB/install/schemas/mysql_basic.sql | 3 ++- phpBB/install/schemas/mysql_schema.sql | 1 + phpBB/install/schemas/postgres_basic.sql | 3 ++- phpBB/install/schemas/postgres_schema.sql | 1 + 6 files changed, 13 insertions(+), 3 deletions(-) diff --git a/phpBB/install/schemas/mssql_basic.sql b/phpBB/install/schemas/mssql_basic.sql index 42193efea5..105d848890 100644 --- a/phpBB/install/schemas/mssql_basic.sql +++ b/phpBB/install/schemas/mssql_basic.sql @@ -51,6 +51,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_password','') INSERT INTO phpbb_config (config_name, config_value) VALUES ('sendmail_fix','0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('require_activation','0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('flood_interval','15'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_flood_interval','15'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_login_attempts', '5'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('login_reset_time', '30'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_form','0'); @@ -73,7 +74,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('record_online_date INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_name', 'www.yourdomain.tld'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_port', '80'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', '/phpBB2/'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '.0.19'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '.0.20'); /* -- Categories diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index c4f92fa8af..74018873db 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -165,6 +165,7 @@ GO CREATE TABLE [phpbb_search_results] ( [search_id] [int] NOT NULL , [session_id] [char] (32) NOT NULL , + [search_time] [int] NOT NULL , [search_array] [text] NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO @@ -593,6 +594,10 @@ ALTER TABLE [phpbb_posts] WITH NOCHECK ADD CONSTRAINT [DF_phpbb_posts_post_edit_count] DEFAULT (0) FOR [post_edit_count] GO +ALTER TABLE [phpbb_search_results] WITH NOCHECK ADD + CONSTRAINT [DF_phpbb_search_results_search_time] DEFAULT (0) FOR [search_time] +GO + ALTER TABLE [phpbb_search_wordlist] WITH NOCHECK ADD CONSTRAINT [DF_phpbb_search_wordlist_word_common] DEFAULT (0) FOR [word_common] GO diff --git a/phpBB/install/schemas/mysql_basic.sql b/phpBB/install/schemas/mysql_basic.sql index 2d1b4a5142..035f1a88a0 100644 --- a/phpBB/install/schemas/mysql_basic.sql +++ b/phpBB/install/schemas/mysql_basic.sql @@ -44,6 +44,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_password','') INSERT INTO phpbb_config (config_name, config_value) VALUES ('sendmail_fix','0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('require_activation','0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('flood_interval','15'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_flood_interval','15'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_login_attempts', '5'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('login_reset_time', '30'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_form','0'); @@ -66,7 +67,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('record_online_date INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_name', 'www.myserver.tld'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_port', '80'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', '/phpBB2/'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '.0.19'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '.0.20'); # -- Categories diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql index 6944a3d8a5..4436df5524 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_schema.sql @@ -256,6 +256,7 @@ CREATE TABLE phpbb_ranks ( CREATE TABLE phpbb_search_results ( search_id int(11) UNSIGNED NOT NULL default '0', session_id char(32) NOT NULL default '', + search_time int(11) DEFAULT '0' NOT NULL, search_array text NOT NULL, PRIMARY KEY (search_id), KEY session_id (session_id) diff --git a/phpBB/install/schemas/postgres_basic.sql b/phpBB/install/schemas/postgres_basic.sql index 0e1c84dfd7..790d9c2683 100644 --- a/phpBB/install/schemas/postgres_basic.sql +++ b/phpBB/install/schemas/postgres_basic.sql @@ -45,6 +45,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_password','') INSERT INTO phpbb_config (config_name, config_value) VALUES ('sendmail_fix','0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('require_activation','0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('flood_interval','15'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_flood_interval','15'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_login_attempts', '5'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('login_reset_time', '30'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_form','0'); @@ -67,7 +68,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('record_online_date INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_name', 'www.yourdomain.tld'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_port', '80'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', '/phpBB2/'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '.0.19'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '.0.20'); -- Categories INSERT INTO phpbb_categories (cat_id, cat_title, cat_order) VALUES (1, 'Test category 1', 10); diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index ac24cff312..964dbfaf6e 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -248,6 +248,7 @@ CREATE TABLE phpbb_ranks ( CREATE TABLE phpbb_search_results ( search_id int4 NOT NULL default '0', session_id char(32) NOT NULL default '', + search_time int4 DEFAULT '0' NOT NULL, search_array text NOT NULL, CONSTRAINT phpbb_search_results_pkey PRIMARY KEY (search_id) );