Skip to content
Snippets Groups Projects
Commit b278671b authored by Hans Salvisberg's avatar Hans Salvisberg
Browse files

Issue #3084233 by salvis: Update 8101 (#3002918) can fail; fix rid width and...

Issue #3084233 by salvis: Update 8101 (#3002918) can fail; fix rid width and redo the update in 8102.
parent 61b89af8
Branches
Tags 8.x-1.0-alpha2
No related merge requests found
......@@ -5,7 +5,12 @@ CHANGELOG for Forum Access for Drupal 8
forum_access 8.x-1.x-dev:
forum_access 8.x-1.x-alpha1 (2019-09-25):
forum_access 8.x-1.0-alpha2 (2019-09-27):
Bug fixed:
- #3084233 by salvis: Update 8101 (#3002918) can fail; fix rid width and redo the update in 8102.
forum_access 8.x-1.0-alpha1 (2019-09-25):
Bugs fixed:
- #3001448 by salvis: PHP notice and other issues with the Update radiobuttons.
- #3011364 by volkswagenchick, salvis: README configs and formatting.
......@@ -16,8 +21,7 @@ forum_access 8.x-1.x-alpha1 (2019-09-25):
Tasks:
- #3081936 by Sergiu Stici: Deprecated Code Report.
forum_access 8.x-1.x-alpha0 (2018-04-11):
forum_access 8.x-1.0-alpha0 (2018-04-11):
Branch to port to D8.
Porting:
- #2959985 by salvis: Fix some minor coding issues.
......
......@@ -15,7 +15,7 @@ use Drupal\user\Entity\Role;
* @inheritdoc
*/
function forum_access_schema() {
return _forum_access_schema_8101();
return _forum_access_schema_8102();
}
/**
......@@ -70,18 +70,29 @@ function forum_access_install() {
}
/**
* Add primary key and index to the {forum_access} table.
* Resize {forum_access}.rid and
* add primary key and index to the {forum_access} table.
*/
function forum_access_update_8101(&$sandbox) {
function forum_access_update_8102(&$sandbox) {
$new_schema = _forum_access_schema_8102();
$schema = Database::getConnection()->schema();
// Drop the primary key and index that may have been created in update_8101.
$schema->dropPrimaryKey('forum_access');
$schema->dropIndex('forum_access', 'rid');
// Adjust the 'rid' field width.
$schema->changeField('forum_access', 'rid', 'rid', $new_schema['forum_access']['fields']['rid']);
// Add the primary key and index (again or for the first time).
$schema->addPrimaryKey('forum_access', ['tid', 'rid']);
$schema->addIndex('forum_access', 'rid', ['rid'], _forum_access_schema_8101()['forum_access']);
$schema->addIndex('forum_access', 'rid', ['rid'], $new_schema['forum_access']);
}
/*
* Implementation of forum_access_schema() version 8101.
* Implementation of forum_access_schema() version 8102.
*/
function _forum_access_schema_8101() {
function _forum_access_schema_8102() {
$schema['forum_access'] = [
'description' => 'The Forum Access control table.',
'fields' => [
......@@ -94,7 +105,7 @@ function _forum_access_schema_8101() {
'rid' => [
'description' => 'The {role}.rid to which this {forum_access} entry applies.',
'type' => 'varchar',
'length' => 255,
'length' => 64,
'not null' => TRUE,
],
'grant_view' => [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment