diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index b909ed0d55..fda21b1321 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -48,6 +48,15 @@ CREATE TABLE [phpbb_config] ( ) ON [PRIMARY] GO + +CREATE TABLE [phpbb_confirm] ( + [confirm_id] [char] (32) NOT NULL , + [session_id] [char] (32) NOT NULL , + [code] [char] (6) NOT NULL , + [time] [int] NOT NULL +) ON [PRIMARY] +GO + CREATE TABLE [phpbb_disallow] ( [disallow_id] [int] IDENTITY (1, 1) NOT NULL , [disallow_username] [varchar] (100) NULL @@ -401,6 +410,13 @@ ALTER TABLE [phpbb_categories] WITH NOCHECK ADD ) ON [PRIMARY] GO +ALTER TABLE [phpbb_confirm] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_confirm] PRIMARY KEY CLUSTERED + ( + [session_id,confirm_id] + ) ON [PRIMARY] +GO + ALTER TABLE [phpbb_disallow] WITH NOCHECK ADD CONSTRAINT [PK_phpbb_disallow] PRIMARY KEY CLUSTERED ( @@ -553,6 +569,13 @@ ALTER TABLE [phpbb_forums] WITH NOCHECK ADD CONSTRAINT [DF_phpbb_forums_auth_attachments] DEFAULT (0) FOR [auth_attachments] GO +ALTER TABLE [phpbb_confirm] WITH NOCHECK ADD + CONSTRAINT [DF_phpbb_confirm_confirm_id] DEFAULT ('') FOR [confirm_id], + CONSTRAINT [DF_phpbb_confirm_session_id] DEFAULT ('') FOR [session_id], + CONSTRAINT [DF_phpbb_confirm_code] DEFAULT ('') FOR [code], + CONSTRAINT [DF_phpbb_confirm_time] DEFAULT (0) FOR [time] +GO + ALTER TABLE [phpbb_posts] WITH NOCHECK ADD CONSTRAINT [DF_phpbb_posts_enable_bbcode] DEFAULT (1) FOR [enable_bbcode], CONSTRAINT [DF_phpbb_posts_enable_html] DEFAULT (0) FOR [enable_html], diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql index f74cd7c4e1..2ff1c25e56 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_schema.sql @@ -93,14 +93,15 @@ CREATE TABLE phpbb_config ( # -------------------------------------------------------- # -# Table structure for table `phpbb_confirm` +# Table structure for table 'phpbb_confirm' # CREATE TABLE phpbb_confirm ( - confirm_id char(32) NOT NULL default '', - session_id char(32) NOT NULL default '', - code char(6) NOT NULL default '', + confirm_id char(32) DEFAULT '' NOT NULL, + session_id char(32) DEFAULT '' NOT NULL, + code char(6) DEFAULT '' NOT NULL, + time int(11) DEFAULT '0' NOT NULL, PRIMARY KEY (session_id,confirm_id), - KEY session_id (session_id) + KEY time (time) ); diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index dde1b1ca83..cbd696e578 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -33,16 +33,29 @@ CREATE TABLE phpbb_auth_access ( auth_reply int2 DEFAULT '0' NOT NULL, auth_edit int2 DEFAULT '0' NOT NULL, auth_delete int2 DEFAULT '0' NOT NULL, - auth_announce int2 DEFAULT '0' NOT NULL, auth_sticky int2 DEFAULT '0' NOT NULL, + auth_announce int2 DEFAULT '0' NOT NULL, + auth_vote int2 DEFAULT '0' NOT NULL, auth_pollcreate int2 DEFAULT '0' NOT NULL, auth_attachments int2 DEFAULT '0' NOT NULL, - auth_vote int2 DEFAULT '0' NOT NULL, auth_mod int2 DEFAULT '0' NOT NULL, CONSTRAINT phpbb_auth_access_pkey PRIMARY KEY (group_id, forum_id) ); +/* -------------------------------------------------------- + Table structure for table phpbb_confirm +-------------------------------------------------------- */ +CREATE TABLE phpbb_confirm ( + confirm_id char(32) DEFAULT '' NOT NULL, + session_id char(32) DEFAULT '' NOT NULL, + code char(6) DEFAULT '' NOT NULL, + time int2 DEFAULT '0' NOT NULL, + CONSTRAINT phpbb_confirm_pkey PRIMARY KEY (session_id, confirm_id) +); +CREATE INDEX time_phpbb_confirm_index ON phpbb_confirm (time); + + /* -------------------------------------------------------- Table structure for table phpbb_groups -------------------------------------------------------- */ diff --git a/phpBB/install/update_to_205.php b/phpBB/install/update_to_205.php index 1385956dcc..466104c8f4 100644 --- a/phpBB/install/update_to_205.php +++ b/phpBB/install/update_to_205.php @@ -496,6 +496,33 @@ switch ($row['config_value']) CONSTRAINT [DF_" . POSTS_TABLE . "_post_edit_count] DEFAULT (0) FOR [post_edit_count]"; break; } + + // Add tables for visual confirmation ... saves me the trouble of writing a seperate + // script :D + switch (SQL_LAYER) + { + case 'mysql': + case 'mysql4': + $sql[] = 'CREATE TABLE ' . $table_prefix . 'confirm (confirm_id char(32) DEFAULT \'\' NOT NULL, session_id char(32) DEFAULT \'\' NOT NULL, code char(6) DEFAULT \'\' NOT NULL, time int(11) DEFAULT \'0\' NOT NULL, PRIMARY KEY (session_id, confirm_id), KEY time (time))'; + break; + + case 'mssql': + $sql[] = 'CREATE TABLE [' . $table_prefix . 'confirm] ([confirm_id] [char] (32) NOT NULL , [session_id] [char] (32) NOT NULL , [code] [char] (6) NOT NULL , [time] [int] NOT NULL ) ON [PRIMARY]'; + $sql[] = 'ALTER TABLE [' . $table_prefix . 'confirm] WITH NOCHECK ADD CONSTRAINT [PK_' . $table_prefix . 'confirm] PRIMARY KEY CLUSTERED ( [session_id,confirm_id]) ON [PRIMARY]'; + $sql[] = 'ALTER TABLE [' . $table_prefix . 'confirm] WITH NOCHECK ADD CONSTRAINT [DF_' . $table_prefix . 'confirm_confirm_id] DEFAULT (\'\') FOR [confirm_id], CONSTRAINT [DF_' . $table_prefix . 'confirm_session_id] DEFAULT (\'\') FOR [session_id], CONSTRAINT [DF_' . $table_prefix . 'confirm_code] DEFAULT (\'\') FOR [code], CONSTRAINT [DF_' . $table_prefix . 'confirm_time] DEFAULT (0) FOR [time]'; + break; + + case 'msaccess': + // TODO + break; + + case 'postgresql': + $sql[] = 'CREATE TABLE ' . $table_prefix . 'confirm (confirm_id char(32) DEFAULT \'\' NOT NULL, session_id char(32) DEFAULT \'\' NOT NULL, code char(6) DEFAULT \'\' NOT NULL, time int2 DEFAULT \'0\' NOT NULL, CONSTRAINT phpbb_confirm_pkey PRIMARY KEY (session_id, confirm_id))'; + $sql[] = 'CREATE INDEX time_' . $table_prefix . 'confirm_index ON ' . $table_prefix . 'confirm (time)'; + break; + } + + break; } echo "