From 2483efe9a34df48a82bcceff5f966881fea2a37e Mon Sep 17 00:00:00 2001 From: Joseph Warner Date: Tue, 23 Jul 2013 22:18:41 -0400 Subject: [PATCH] [feature/oauth] Actual final schema changes PHPBB3-11673 --- phpBB/develop/create_schema_files.php | 10 +++++----- phpBB/install/schemas/firebird_schema.sql | 8 ++++---- phpBB/install/schemas/mssql_schema.sql | 8 ++++---- phpBB/install/schemas/mysql_40_schema.sql | 4 ++-- phpBB/install/schemas/mysql_41_schema.sql | 4 ++-- phpBB/install/schemas/oracle_schema.sql | 8 ++++---- phpBB/install/schemas/postgres_schema.sql | 8 ++++---- phpBB/install/schemas/sqlite_schema.sql | 8 ++++---- .../db/migration/data/310/auth_provider_oauth.php | 10 +++++----- 9 files changed, 34 insertions(+), 34 deletions(-) diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index af6e959b98..6f88b28140 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -927,20 +927,20 @@ function get_schema_struct() 'COLUMNS' => array( 'user_id' => array('UINT', 0), // phpbb_users.user_id 'session_id' => array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set - 'provider' => array('VCHAR'), // Name of the OAuth provider - 'oauth_token' => array('TEXT_UNI'), // Serialized token + 'provider' => array('VCHAR', ''), // Name of the OAuth provider + 'oauth_token' => array('TEXT_UNI', ''), // Serialized token ), 'KEYS' => array( 'user_id' => array('INDEX', 'user_id'), - 'provider' => array('INDEX', 'oauth_provider'), + 'provider' => array('INDEX', 'oauth_provider'), ), ); $schema_data['phpbb_oauth_accounts'] = array( 'COLUMNS' => array( 'user_id' => array('UINT', 0), - 'provider' => array('VCHAR'), - 'oauth_provider_id' => array('TEXT_UNI'), + 'provider' => array('VCHAR', ''), + 'oauth_provider_id' => array('TEXT_UNI', ''), ), 'PRIMARY_KEY' => array( 'user_id', diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 1eabd2f049..55ddd00d7d 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -132,8 +132,8 @@ CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users(auth_role_id);; CREATE TABLE phpbb_oauth_tokens ( user_id INTEGER DEFAULT 0 NOT NULL, session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, - provider VARCHAR(255) CHARACTER SET NONE NOT NULL, - oauth_token BLOB SUB_TYPE TEXT CHARACTER SET UTF8 NOT NULL + provider VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + oauth_token BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL );; CREATE INDEX phpbb_oauth_tokens_user_id ON phpbb_oauth_tokens(user_id);; @@ -142,8 +142,8 @@ CREATE INDEX phpbb_oauth_tokens_provider ON phpbb_oauth_tokens(oauth_provider);; # Table: 'phpbb_oauth_accounts' CREATE TABLE phpbb_oauth_accounts ( user_id INTEGER DEFAULT 0 NOT NULL, - provider VARCHAR(255) CHARACTER SET NONE NOT NULL, - oauth_provider_id BLOB SUB_TYPE TEXT CHARACTER SET UTF8 NOT NULL + provider VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + oauth_provider_id BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL );; ALTER TABLE phpbb_oauth_accounts ADD PRIMARY KEY (user_id, provider);; diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 36e3910bc8..b2fe8d1710 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -172,8 +172,8 @@ GO CREATE TABLE [phpbb_oauth_tokens] ( [user_id] [int] DEFAULT (0) NOT NULL , [session_id] [char] (32) DEFAULT ('') NOT NULL , - [provider] [varchar] (255) NOT NULL , - [oauth_token] [varchar] (4000) NOT NULL + [provider] [varchar] (255) DEFAULT ('') NOT NULL , + [oauth_token] [varchar] (4000) DEFAULT ('') NOT NULL ) ON [PRIMARY] GO @@ -189,8 +189,8 @@ GO */ CREATE TABLE [phpbb_oauth_accounts] ( [user_id] [int] DEFAULT (0) NOT NULL , - [provider] [varchar] (255) NOT NULL , - [oauth_provider_id] [varchar] (4000) NOT NULL + [provider] [varchar] (255) DEFAULT ('') NOT NULL , + [oauth_provider_id] [varchar] (4000) DEFAULT ('') NOT NULL ) ON [PRIMARY] GO diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index ea9c6419db..9eb2e10e96 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -94,7 +94,7 @@ CREATE TABLE phpbb_acl_users ( CREATE TABLE phpbb_oauth_tokens ( user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, session_id binary(32) DEFAULT '' NOT NULL, - provider varbinary(255) NOT NULL, + provider varbinary(255) DEFAULT '' NOT NULL, oauth_token blob NOT NULL, KEY user_id (user_id), KEY provider (oauth_provider) @@ -104,7 +104,7 @@ CREATE TABLE phpbb_oauth_tokens ( # Table: 'phpbb_oauth_accounts' CREATE TABLE phpbb_oauth_accounts ( user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - provider varbinary(255) NOT NULL, + provider varbinary(255) DEFAULT '' NOT NULL, oauth_provider_id blob NOT NULL, PRIMARY KEY (user_id, provider) ); diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 0d81f03d17..a4237acb8a 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -94,7 +94,7 @@ CREATE TABLE phpbb_acl_users ( CREATE TABLE phpbb_oauth_tokens ( user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, session_id char(32) DEFAULT '' NOT NULL, - provider varchar(255) NOT NULL, + provider varchar(255) DEFAULT '' NOT NULL, oauth_token text NOT NULL, KEY user_id (user_id), KEY provider (oauth_provider) @@ -104,7 +104,7 @@ CREATE TABLE phpbb_oauth_tokens ( # Table: 'phpbb_oauth_accounts' CREATE TABLE phpbb_oauth_accounts ( user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - provider varchar(255) NOT NULL, + provider varchar(255) DEFAULT '' NOT NULL, oauth_provider_id text NOT NULL, PRIMARY KEY (user_id, provider) ) CHARACTER SET `utf8` COLLATE `utf8_bin`; diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 0868972d2d..6a6d691190 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -216,8 +216,8 @@ CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users (auth_role_id) CREATE TABLE phpbb_oauth_tokens ( user_id number(8) DEFAULT '0' NOT NULL, session_id char(32) DEFAULT '' , - provider varchar2(255) NOT NULL, - oauth_token clob NOT NULL + provider varchar2(255) DEFAULT '' , + oauth_token clob DEFAULT '' ) / @@ -231,8 +231,8 @@ CREATE INDEX phpbb_oauth_tokens_provider ON phpbb_oauth_tokens (oauth_provider) */ CREATE TABLE phpbb_oauth_accounts ( user_id number(8) DEFAULT '0' NOT NULL, - provider varchar2(255) NOT NULL, - oauth_provider_id clob NOT NULL, + provider varchar2(255) DEFAULT '' , + oauth_provider_id clob DEFAULT '' , CONSTRAINT pk_phpbb_oauth_accounts PRIMARY KEY (user_id, provider) ) / diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 4b8f8f61e1..135cd23fb8 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -194,8 +194,8 @@ CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users (auth_role_id); CREATE TABLE phpbb_oauth_tokens ( user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), session_id char(32) DEFAULT '' NOT NULL, - provider varchar(255) NOT NULL, - oauth_token varchar(4000) NOT NULL + provider varchar(255) DEFAULT '' NOT NULL, + oauth_token varchar(4000) DEFAULT '' NOT NULL ); CREATE INDEX phpbb_oauth_tokens_user_id ON phpbb_oauth_tokens (user_id); @@ -206,8 +206,8 @@ CREATE INDEX phpbb_oauth_tokens_provider ON phpbb_oauth_tokens (oauth_provider); */ CREATE TABLE phpbb_oauth_accounts ( user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - provider varchar(255) NOT NULL, - oauth_provider_id varchar(4000) NOT NULL, + provider varchar(255) DEFAULT '' NOT NULL, + oauth_provider_id varchar(4000) DEFAULT '' NOT NULL, PRIMARY KEY (user_id, provider) ); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 3e429850b4..625e19eb98 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -93,8 +93,8 @@ CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users (auth_role_id); CREATE TABLE phpbb_oauth_tokens ( user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', session_id char(32) NOT NULL DEFAULT '', - provider varchar(255) NOT NULL , - oauth_token text(65535) NOT NULL + provider varchar(255) NOT NULL DEFAULT '', + oauth_token text(65535) NOT NULL DEFAULT '' ); CREATE INDEX phpbb_oauth_tokens_user_id ON phpbb_oauth_tokens (user_id); @@ -103,8 +103,8 @@ CREATE INDEX phpbb_oauth_tokens_provider ON phpbb_oauth_tokens (oauth_provider); # Table: 'phpbb_oauth_accounts' CREATE TABLE phpbb_oauth_accounts ( user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - provider varchar(255) NOT NULL , - oauth_provider_id text(65535) NOT NULL , + provider varchar(255) NOT NULL DEFAULT '', + oauth_provider_id text(65535) NOT NULL DEFAULT '', PRIMARY KEY (user_id, provider) ); diff --git a/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php b/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php index 5a7f9b5c8d..0d8e8858bb 100644 --- a/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php +++ b/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php @@ -22,23 +22,23 @@ class phpbb_db_migration_data_310_auth_provider_oauth extends phpbb_db_migration 'COLUMNS' => array( 'user_id' => array('UINT', 0), // phpbb_users.user_id 'session_id' => array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set - 'oauth_provider' => array('VCHAR'), // Name of the OAuth provider + 'provider' => array('VCHAR', ''), // Name of the OAuth provider 'oauth_token' => array('TEXT_UNI'), // Serialized token ), 'KEYS' => array( 'user_id' => array('INDEX', 'user_id'), - 'oauth_provider' => array('INDEX', 'oauth_provider'), + 'provider' => array('INDEX', 'oauth_provider'), ), ), $this->table_prefix . 'oauth_accounts' => array( 'COLUMNS' => array( 'user_id' => array('UINT', 0), - 'oauth_provider' => array('VCHAR'), - 'oauth_provider_id' => array('TEXT_UNI'), + 'provider' => array('VCHAR', ''), + 'oauth_provider_id' => array('TEXT_UNI', ''), ), 'PRIMARY_KEY' => array( 'user_id', - 'oauth_provider', + 'provider', ), ), ),