2018-01-12 02:05:50 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Contains install and update functions for Migrate Drupal
|
|
|
|
*/
|
|
|
|
|
Issue #2746541 by quietone, alexpott, maxocub, Wim Leers, mikelutz, jofitz, masipila, firewaller, Madhura BK, Gábor Hojtsy, catch, heddn, plach, hchonov: Migrate D6 and D7 node revision translations to D8
2020-03-12 12:00:10 +00:00
|
|
|
use Drupal\Core\Database\Database;
|
|
|
|
|
2018-01-12 02:05:50 +00:00
|
|
|
/**
|
Issue #3087644 by jibran, Berdir, alexpott, longwave, Wim Leers, amateescu, catch, xjm, larowlan, dpi, quietone: Remove Drupal 8 updates up to and including 88**
2020-01-24 23:52:03 +00:00
|
|
|
* Implements hook_update_last_removed().
|
2018-01-12 02:05:50 +00:00
|
|
|
*/
|
Issue #3087644 by jibran, Berdir, alexpott, longwave, Wim Leers, amateescu, catch, xjm, larowlan, dpi, quietone: Remove Drupal 8 updates up to and including 88**
2020-01-24 23:52:03 +00:00
|
|
|
function migrate_drupal_update_last_removed() {
|
|
|
|
return 8601;
|
2018-07-26 16:49:16 +00:00
|
|
|
}
|
Issue #2746541 by quietone, alexpott, maxocub, Wim Leers, mikelutz, jofitz, masipila, firewaller, Madhura BK, Gábor Hojtsy, catch, heddn, plach, hchonov: Migrate D6 and D7 node revision translations to D8
2020-03-12 12:00:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add revision ID to entity reference translation migrate_map tables..
|
|
|
|
*/
|
|
|
|
function migrate_drupal_update_8901(&$sandbox) {
|
|
|
|
$schema = Database::getConnection()->schema();
|
|
|
|
$table_expression = 'migrate_map%entity_reference_translation%node%';
|
|
|
|
$tables = $schema->findTables($table_expression);
|
|
|
|
foreach ($tables as $table) {
|
|
|
|
// Move language code to sourceid3.
|
|
|
|
$spec = [
|
|
|
|
'type' => 'varchar',
|
|
|
|
'length' => 12,
|
|
|
|
'not null' => TRUE,
|
|
|
|
];
|
|
|
|
$schema->changeField($table, 'sourceid2', 'sourceid3', $spec);
|
|
|
|
|
|
|
|
// Add revision ID.
|
|
|
|
$spec = [
|
|
|
|
'type' => 'int',
|
|
|
|
'unsigned' => TRUE,
|
|
|
|
'not null' => TRUE,
|
|
|
|
'default' => 0,
|
|
|
|
];
|
|
|
|
$schema->addField($table, 'sourceid2', $spec);
|
|
|
|
|
|
|
|
// Add sourceid2 to index.
|
|
|
|
$spec = [
|
|
|
|
'fields' => [
|
|
|
|
'sourceid1' => [
|
|
|
|
'type' => 'int',
|
|
|
|
'not_null' => TRUE,
|
|
|
|
],
|
|
|
|
'sourceid2' => [
|
|
|
|
'type' => 'int',
|
|
|
|
'not_null' => TRUE,
|
|
|
|
],
|
|
|
|
'sourceid3' => [
|
|
|
|
'type' => 'varchar',
|
|
|
|
'length' => 12,
|
|
|
|
'not null' => TRUE,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
];
|
|
|
|
$fields = [
|
|
|
|
'sourceid1',
|
|
|
|
'sourceid2',
|
|
|
|
'sourceid3',
|
|
|
|
];
|
|
|
|
$schema->dropIndex($table, 'source');
|
|
|
|
$schema->addIndex($table, 'source', $fields, $spec);
|
|
|
|
}
|
|
|
|
}
|