clean install

This commit is contained in:
2024-12-10 15:08:16 +01:00
commit e14eb2d8fd
31193 changed files with 3555714 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
langcode: en
status: true
dependencies:
enforced:
module:
- migrate_example_setup
id: node_comments
label: 'Node comments'
target_entity_type_id: node
description: ''

View File

@@ -0,0 +1,30 @@
langcode: en
status: true
dependencies:
config:
- comment.type.node_comments
- field.field.comment.node_comments.comment_body
module:
- text
id: comment.node_comments.default
targetEntityType: comment
bundle: node_comments
mode: default
content:
author:
weight: -2
comment_body:
type: text_textarea
weight: 11
settings:
rows: 5
placeholder: ''
third_party_settings: { }
subject:
type: string_textfield
weight: 10
settings:
size: 60
placeholder: ''
third_party_settings: { }
hidden: { }

View File

@@ -0,0 +1,89 @@
langcode: en
status: true
dependencies:
config:
- field.field.node.migrate_example_beer.body
- field.field.node.migrate_example_beer.field_comments
- field.field.node.migrate_example_beer.field_migrate_example_beer_style
- field.field.node.migrate_example_beer.field_migrate_example_country
- field.field.node.migrate_example_beer.field_migrate_example_image
- node.type.migrate_example_beer
module:
- comment
- image
- text
id: node.migrate_example_beer.default
targetEntityType: node
bundle: migrate_example_beer
mode: default
content:
body:
type: text_textarea_with_summary
weight: 6
settings:
rows: 9
summary_rows: 3
placeholder: ''
third_party_settings: { }
created:
type: datetime_timestamp
weight: 2
settings: { }
third_party_settings: { }
field_comments:
weight: 10
settings: { }
third_party_settings: { }
type: comment_default
field_migrate_example_beer_style:
weight: 7
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
type: entity_reference_autocomplete
field_migrate_example_country:
weight: 8
settings:
size: 60
placeholder: ''
third_party_settings: { }
type: string_textfield
field_migrate_example_image:
weight: 9
settings:
progress_indicator: throbber
preview_image_style: thumbnail
third_party_settings: { }
type: image_image
promote:
type: boolean_checkbox
settings:
display_label: true
weight: 3
third_party_settings: { }
sticky:
type: boolean_checkbox
settings:
display_label: true
weight: 4
third_party_settings: { }
title:
type: string_textfield
weight: 0
settings:
size: 60
placeholder: ''
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 1
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
hidden: { }

View File

@@ -0,0 +1,22 @@
langcode: en
status: true
dependencies:
config:
- comment.type.node_comments
- field.field.comment.node_comments.comment_body
module:
- text
id: comment.node_comments.default
targetEntityType: comment
bundle: node_comments
mode: default
content:
comment_body:
label: hidden
type: text_default
weight: 0
settings: { }
third_party_settings: { }
links:
weight: 100
hidden: { }

View File

@@ -0,0 +1,60 @@
langcode: en
status: true
dependencies:
config:
- field.field.node.migrate_example_beer.body
- field.field.node.migrate_example_beer.field_comments
- field.field.node.migrate_example_beer.field_migrate_example_beer_style
- field.field.node.migrate_example_beer.field_migrate_example_country
- field.field.node.migrate_example_beer.field_migrate_example_image
- node.type.migrate_example_beer
module:
- comment
- image
- text
- user
id: node.migrate_example_beer.default
targetEntityType: node
bundle: migrate_example_beer
mode: default
content:
body:
label: hidden
type: text_default
weight: 2
settings: { }
third_party_settings: { }
field_comments:
weight: 5
label: above
settings:
pager_id: 0
third_party_settings: { }
type: comment_default
field_migrate_example_beer_style:
weight: 3
label: above
settings:
link: true
third_party_settings: { }
type: entity_reference_label
field_migrate_example_country:
weight: 4
label: above
settings:
link_to_entity: false
third_party_settings: { }
type: string
field_migrate_example_image:
weight: 1
label: above
settings:
image_style: ''
image_link: ''
third_party_settings: { }
type: image
links:
weight: 0
settings: { }
third_party_settings: { }
hidden: { }

View File

@@ -0,0 +1,35 @@
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.node.teaser
- field.field.node.migrate_example_beer.body
- field.field.node.migrate_example_beer.field_comments
- field.field.node.migrate_example_beer.field_migrate_example_beer_style
- field.field.node.migrate_example_beer.field_migrate_example_country
- field.field.node.migrate_example_beer.field_migrate_example_image
- node.type.migrate_example_beer
module:
- text
- user
id: node.migrate_example_beer.teaser
targetEntityType: node
bundle: migrate_example_beer
mode: teaser
content:
body:
label: hidden
type: text_summary_or_trimmed
weight: 1
settings:
trim_length: 600
third_party_settings: { }
links:
weight: 0
settings: { }
third_party_settings: { }
hidden:
field_comments: true
field_migrate_example_beer_style: true
field_migrate_example_country: true
field_migrate_example_image: true

View File

@@ -0,0 +1,20 @@
langcode: en
status: true
dependencies:
config:
- comment.type.node_comments
- field.storage.comment.comment_body
module:
- text
id: comment.node_comments.comment_body
field_name: comment_body
entity_type: comment
bundle: node_comments
label: Comment
description: ''
required: true
translatable: true
default_value: { }
default_value_callback: ''
settings: { }
field_type: text_long

View File

@@ -0,0 +1,21 @@
langcode: en
status: true
dependencies:
config:
- field.storage.node.body
- node.type.migrate_example_beer
module:
- text
id: node.migrate_example_beer.body
field_name: body
entity_type: node
bundle: migrate_example_beer
label: Body
description: ''
required: false
translatable: true
default_value: { }
default_value_callback: ''
settings:
display_summary: true
field_type: text_with_summary

View File

@@ -0,0 +1,32 @@
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_comments
- node.type.migrate_example_beer
module:
- comment
id: node.migrate_example_beer.field_comments
field_name: field_comments
entity_type: node
bundle: migrate_example_beer
label: Comments
description: ''
required: false
translatable: false
default_value:
-
status: 2
cid: 0
last_comment_timestamp: 0
last_comment_name: null
last_comment_uid: 0
comment_count: 0
default_value_callback: ''
settings:
default_mode: 1
per_page: 50
anonymous: 0
form_location: true
preview: 1
field_type: comment

View File

@@ -0,0 +1,26 @@
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_migrate_example_beer_style
- node.type.migrate_example_beer
- taxonomy.vocabulary.migrate_example_beer_styles
id: node.migrate_example_beer.field_migrate_example_beer_style
field_name: field_migrate_example_beer_style
entity_type: node
bundle: migrate_example_beer
label: 'Migrate Example Beer Styles'
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings:
handler: 'default:taxonomy_term'
handler_settings:
target_bundles:
migrate_example_beer_styles: migrate_example_beer_styles
sort:
field: _none
auto_create: false
field_type: entity_reference

View File

@@ -0,0 +1,18 @@
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_migrate_example_country
- node.type.migrate_example_beer
id: node.migrate_example_beer.field_migrate_example_country
field_name: field_migrate_example_country
entity_type: node
bundle: migrate_example_beer
label: Countries
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string

View File

@@ -0,0 +1,37 @@
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_migrate_example_image
- node.type.migrate_example_beer
module:
- image
id: node.migrate_example_beer.field_migrate_example_image
field_name: field_migrate_example_image
entity_type: node
bundle: migrate_example_beer
label: Image
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings:
file_directory: ''
file_extensions: 'png gif jpg jpeg'
max_filesize: ''
max_resolution: ''
min_resolution: ''
alt_field: true
alt_field_required: false
title_field: false
title_field_required: false
default_image:
uuid: ''
alt: ''
title: ''
width: null
height: null
handler: 'default:file'
handler_settings: { }
field_type: image

View File

@@ -0,0 +1,27 @@
langcode: en
status: true
dependencies:
config:
- field.storage.user.field_migrate_example_favbeers
- node.type.migrate_example_beer
module:
- user
id: user.user.field_migrate_example_favbeers
field_name: field_migrate_example_favbeers
entity_type: user
bundle: user
label: 'Favorite Beers'
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings:
handler: 'default:node'
handler_settings:
target_bundles:
migrate_example_beer: migrate_example_beer
sort:
field: title
direction: ASC
field_type: entity_reference

View File

@@ -0,0 +1,19 @@
langcode: en
status: true
dependencies:
config:
- field.storage.user.field_migrate_example_gender
module:
- user
id: user.user.field_migrate_example_gender
field_name: field_migrate_example_gender
entity_type: user
bundle: user
label: Gender
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string

View File

@@ -0,0 +1,22 @@
langcode: en
status: true
dependencies:
enforced:
module:
- migrate_example_setup
module:
- comment
- node
id: node.field_comments
field_name: field_comments
entity_type: node
type: comment
settings:
comment_type: node_comments
module: comment
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@@ -0,0 +1,22 @@
langcode: en
status: true
dependencies:
enforced:
module:
- migrate_example_setup
module:
- node
- taxonomy
id: node.field_migrate_example_beer_style
field_name: field_migrate_example_beer_style
entity_type: node
type: entity_reference
settings:
target_type: taxonomy_term
module: core
locked: false
cardinality: -1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@@ -0,0 +1,23 @@
langcode: en
status: true
dependencies:
enforced:
module:
- migrate_example_setup
module:
- node
id: node.field_migrate_example_country
field_name: field_migrate_example_country
entity_type: node
type: string
settings:
max_length: 255
is_ascii: false
case_sensitive: false
module: core
locked: false
cardinality: -1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@@ -0,0 +1,32 @@
langcode: en
status: true
dependencies:
enforced:
module:
- migrate_example_setup
module:
- file
- image
- node
id: node.field_migrate_example_image
field_name: field_migrate_example_image
entity_type: node
type: image
settings:
uri_scheme: public
default_image:
uuid: ''
alt: ''
title: ''
width: null
height: null
target_type: file
display_field: false
display_default: false
module: image
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@@ -0,0 +1,22 @@
langcode: en
status: true
dependencies:
enforced:
module:
- migrate_example_setup
module:
- node
- user
id: user.field_migrate_example_favbeers
field_name: field_migrate_example_favbeers
entity_type: user
type: entity_reference
settings:
target_type: node
module: core
locked: false
cardinality: -1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@@ -0,0 +1,23 @@
langcode: en
status: true
dependencies:
enforced:
module:
- migrate_example_setup
module:
- user
id: user.field_migrate_example_gender
field_name: field_migrate_example_gender
entity_type: user
type: string
settings:
max_length: 255
is_ascii: false
case_sensitive: false
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

View File

@@ -0,0 +1,13 @@
langcode: en
status: true
dependencies:
enforced:
module:
- migrate_example_setup
name: Beer
type: migrate_example_beer
description: 'Beer is what we drink.'
help: ''
new_revision: false
preview_mode: 1
display_submitted: true

View File

@@ -0,0 +1,11 @@
langcode: en
status: true
dependencies:
enforced:
module:
- migrate_example_setup
name: 'Migrate Example Beer Styles'
vid: migrate_example_beer_styles
description: 'Use tags to group beers on similar topics into categories.'
hierarchy: 0
weight: 0

View File

@@ -0,0 +1,17 @@
type: module
name: Migrate Example Setup
description: 'Separate site configuration for the example from the actual migration.'
package: Migration
core_version_requirement: '>=9.1'
hidden: true
dependencies:
- drupal:comment
- drupal:image
- drupal:text
- drupal:options
- drupal:taxonomy
# Information added by Drupal.org packaging script on 2024-11-20
version: '6.0.5'
project: 'migrate_plus'
datestamp: 1732124626

View File

@@ -0,0 +1,502 @@
<?php
declare(strict_types = 1);
/**
* @file
* Install file for migrate example module.
*
* Set up source data and destination configuration for the migration example
* module. We do this in a separate module so migrate_example itself is a pure
* migration module.
*/
/**
* Implements hook_schema().
*/
function migrate_example_setup_schema(): array {
$schema = [];
$schema['migrate_example_beer_account'] = migrate_example_beer_schema_account();
$schema['migrate_example_beer_node'] = migrate_example_beer_schema_node();
$schema['migrate_example_beer_comment'] = migrate_example_beer_schema_comment();
$schema['migrate_example_beer_topic'] = migrate_example_beer_schema_topic();
$schema['migrate_example_beer_topic_node'] = migrate_example_beer_schema_topic_node();
return $schema;
}
/**
* Implements hook_install().
*/
function migrate_example_setup_install(): void {
// Populate our tables.
migrate_example_beer_data_account();
migrate_example_beer_data_node();
migrate_example_beer_data_comment();
migrate_example_beer_data_topic();
migrate_example_beer_data_topic_node();
}
/**
* The hook_schema definition for node.
*
* The schema definition.
*/
function migrate_example_beer_schema_node(): array {
return [
'description' => 'Beers of the world.',
'fields' => [
'bid' => [
'type' => 'serial',
'not null' => TRUE,
'description' => 'Beer ID.',
],
'name' => [
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
],
'body' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Full description of the beer.',
],
'excerpt' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Abstract for this beer.',
],
'countries' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Countries of origin. Multiple values, delimited by pipe',
],
'aid' => [
'type' => 'int',
'not null' => FALSE,
'description' => 'Account Id of the author.',
],
'image' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Image path',
],
'image_alt' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Image ALT',
],
'image_title' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Image title',
],
'image_description' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Image description',
],
],
'primary key' => ['bid'],
];
}
/**
* The hook_schema definition for topic.
*
* The schema definition.
*/
function migrate_example_beer_schema_topic(): array {
return [
'description' => 'Categories',
'fields' => [
'style' => [
'type' => 'varchar_ascii',
'length' => 255,
'not null' => TRUE,
],
'details' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
],
'style_parent' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Parent topic, if any',
],
'region' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Region first associated with this style',
],
'hoppiness' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Relative hoppiness of the beer',
],
],
'primary key' => ['style'],
];
}
/**
* The hook_schema definition for topic node.
*
* The schema definition.
*/
function migrate_example_beer_schema_topic_node(): array {
return [
'description' => 'Beers topic pairs.',
'fields' => [
'bid' => [
'type' => 'int',
'not null' => TRUE,
'description' => 'Beer ID.',
],
'style' => [
'type' => 'varchar_ascii',
'length' => 255,
'not null' => TRUE,
'description' => 'Topic name',
],
],
'primary key' => ['style', 'bid'],
];
}
/**
* The hook_schema definition for comment.
*
* The schema definition.
*/
function migrate_example_beer_schema_comment(): array {
return [
'description' => 'Beers comments.',
'fields' => [
'cid' => [
'type' => 'serial',
'not null' => TRUE,
'description' => 'Comment ID.',
],
'bid' => [
'type' => 'int',
'not null' => TRUE,
'description' => 'Beer ID that is being commented upon',
],
'cid_parent' => [
'type' => 'int',
'not null' => FALSE,
'description' => 'Parent comment ID in case of comment replies.',
],
'subject' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Comment subject',
],
'body' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Comment body',
],
'name' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Comment name (if anon)',
],
'mail' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Comment email (if anon)',
],
'aid' => [
'type' => 'int',
'not null' => FALSE,
'description' => 'Account ID (if any).',
],
],
'primary key' => ['cid'],
];
}
/**
* The hook_schema definition for account.
*
* The schema definition.
*/
function migrate_example_beer_schema_account(): array {
return [
'description' => 'Beers accounts.',
'fields' => [
'aid' => [
'type' => 'serial',
'not null' => TRUE,
'description' => 'Account ID',
],
'status' => [
'type' => 'int',
'not null' => TRUE,
'description' => 'Blocked_Allowed',
],
'registered' => [
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'description' => 'Registration date',
],
'username' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Account name (for login)',
],
'nickname' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Account name (for display)',
],
'password' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Account password (raw)',
],
'email' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Account email',
],
'sex' => [
'type' => 'int',
'not null' => FALSE,
'description' => 'Gender (0 for male, 1 for female)',
],
'beers' => [
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'Favorite Beers',
],
],
'primary key' => ['aid'],
];
}
/**
* Populate node table.
*/
function migrate_example_beer_data_node(): void {
$fields = [
'bid',
'name',
'body',
'excerpt',
'countries',
'aid',
'image',
'image_alt',
'image_title',
'image_description',
];
$query = \Drupal::database()->insert('migrate_example_beer_node')
->fields($fields);
// Use high bid numbers to avoid overwriting an existing node id.
$data = [
// Comes with migrate_example project.
[
99999999,
'Heineken',
'Blab Blah Blah Green',
'Green',
'Netherlands|Belgium',
1,
'heineken.jpg',
'Heinekin alt',
'Heinekin title',
'Heinekin description',
],
[
99999998,
'Miller Lite',
'We love Miller Brewing',
'Tasteless',
'USA|Canada',
2,
NULL,
NULL,
NULL,
NULL,
],
[
99999997,
'Boddington',
'English occasionally get something right',
'A treat',
'United Kingdom',
2,
NULL,
NULL,
NULL,
NULL,
],
];
foreach ($data as $row) {
$query->values(array_combine($fields, $row));
}
$query->execute();
}
/**
* Populate account table.
*
* Note that alice has duplicate username. Exercises make_unique_entity_field
* plugin.
*
* @todo Duplicate email also.
*/
function migrate_example_beer_data_account(): void {
$fields = [
'status',
'registered',
'username',
'nickname',
'password',
'email',
'sex',
'beers',
];
$query = \Drupal::database()->insert('migrate_example_beer_account')
->fields($fields);
$data = [
[
1,
'2010-03-30 10:31:05',
'alice',
'alice in beerland',
'alicepass',
'alice@example.com',
'1',
'99999999|99999998|99999997',
],
[
1,
'2010-04-04 10:31:05',
'alice',
'alice in aleland',
'alicepass',
'alice2@example.com',
'1',
'99999999|99999998|99999997',
],
[
0,
'2007-03-15 10:31:05',
'bob',
'rebob',
'bobpass',
'bob@example.com',
'0',
'99999999|99999997',
],
[
1,
'2004-02-29 10:31:05',
'charlie',
'charlie chocolate',
'mykids',
'charlie@example.com',
'0',
'99999999|99999998',
],
];
foreach ($data as $row) {
$query->values(array_combine($fields, $row));
}
$query->execute();
}
/**
* Populate comment table.
*/
function migrate_example_beer_data_comment(): void {
$fields = ['bid', 'cid_parent', 'subject', 'body', 'name', 'mail', 'aid'];
$query = \Drupal::database()->insert('migrate_example_beer_comment')
->fields($fields);
$data = [
[99999998, NULL, 'im first', 'full body', 'alice', 'alice@example.com', 1],
[99999998, NULL, 'im second', 'aromatic', 'alice', 'alice@example.com', 1],
[99999999, NULL, 'im parent', 'malty', 'alice', 'alice@example.com', 1],
[99999999, 1, 'im child', 'cold body', 'bob', NULL, 2],
[
99999999,
4,
'im grandchild',
'bitter body',
'charlie@example.com',
NULL,
1,
],
];
foreach ($data as $row) {
$query->values(array_combine($fields, $row));
}
$query->execute();
}
/**
* Populate topic table.
*/
function migrate_example_beer_data_topic(): void {
$fields = ['style', 'details', 'style_parent', 'region', 'hoppiness'];
$query = \Drupal::database()->insert('migrate_example_beer_topic')
->fields($fields);
$data = [
['ale', 'traditional', NULL, 'Medieval British Isles', 'Medium'],
['red ale', 'colorful', 'ale', NULL, NULL],
[
'pilsner',
'refreshing',
NULL,
'Pilsen, Bohemia (now Czech Republic)',
'Low',
],
];
foreach ($data as $row) {
$query->values(array_combine($fields, $row));
}
$query->execute();
}
/**
* Populate topic node table.
*/
function migrate_example_beer_data_topic_node(): void {
$fields = ['bid', 'style'];
$query = \Drupal::database()->insert('migrate_example_beer_topic_node')
->fields($fields);
$data = [
[99999999, 'pilsner'],
[99999999, 'red ale'],
[99999998, 'red ale'],
];
foreach ($data as $row) {
$query->values(array_combine($fields, $row));
}
$query->execute();
}