Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
migrate_plus
Commits
7a526044
Commit
7a526044
authored
Feb 13, 2018
by
heddn
Committed by
heddn
Feb 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2944544
by heddn: Fix failing phpcs testing
parent
81482505
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
974 additions
and
321 deletions
+974
-321
migrate_example/migrate_example_setup/migrate_example_setup.install
...ample/migrate_example_setup/migrate_example_setup.install
+168
-13
migrate_example/src/Plugin/migrate/source/BeerComment.php
migrate_example/src/Plugin/migrate/source/BeerComment.php
+11
-2
migrate_example/src/Plugin/migrate/source/BeerNode.php
migrate_example/src/Plugin/migrate/source/BeerNode.php
+25
-19
migrate_example/src/Plugin/migrate/source/BeerTerm.php
migrate_example/src/Plugin/migrate/source/BeerTerm.php
+24
-28
migrate_example/src/Plugin/migrate/source/BeerUser.php
migrate_example/src/Plugin/migrate/source/BeerUser.php
+25
-20
migrate_example_advanced/migrate_example_advanced.install
migrate_example_advanced/migrate_example_advanced.install
+6
-6
migrate_example_advanced/migrate_example_advanced_setup/migrate_example_advanced_setup.install
...ple_advanced_setup/migrate_example_advanced_setup.install
+366
-40
migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyItems.php
..._advanced_setup/src/Plugin/rest/resource/VarietyItems.php
+8
-4
migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyMultiFiles.php
...nced_setup/src/Plugin/rest/resource/VarietyMultiFiles.php
+8
-4
migrate_example_advanced/src/Plugin/migrate/source/WineTerm.php
...e_example_advanced/src/Plugin/migrate/source/WineTerm.php
+10
-3
phpcs.xml
phpcs.xml
+174
-93
src/Annotation/Authentication.php
src/Annotation/Authentication.php
+1
-1
src/Annotation/DataFetcher.php
src/Annotation/DataFetcher.php
+1
-1
src/Annotation/DataParser.php
src/Annotation/DataParser.php
+1
-1
src/AuthenticationPluginManager.php
src/AuthenticationPluginManager.php
+1
-1
src/DataFetcherPluginInterface.php
src/DataFetcherPluginInterface.php
+4
-3
src/DataFetcherPluginManager.php
src/DataFetcherPluginManager.php
+1
-1
src/DataParserPluginBase.php
src/DataParserPluginBase.php
+4
-3
src/DataParserPluginManager.php
src/DataParserPluginManager.php
+1
-1
src/Event/MigrateEvents.php
src/Event/MigrateEvents.php
+2
-1
src/Plugin/migrate/destination/Table.php
src/Plugin/migrate/destination/Table.php
+14
-0
src/Plugin/migrate/process/EntityGenerate.php
src/Plugin/migrate/process/EntityGenerate.php
+1
-1
src/Plugin/migrate/process/EntityLookup.php
src/Plugin/migrate/process/EntityLookup.php
+5
-5
src/Plugin/migrate/process/FileBlob.php
src/Plugin/migrate/process/FileBlob.php
+1
-1
src/Plugin/migrate/process/SkipOnValue.php
src/Plugin/migrate/process/SkipOnValue.php
+4
-4
src/Plugin/migrate/process/StrReplace.php
src/Plugin/migrate/process/StrReplace.php
+26
-26
src/Plugin/migrate/process/Transliteration.php
src/Plugin/migrate/process/Transliteration.php
+3
-3
src/Plugin/migrate_plus/authentication/OAuth2.php
src/Plugin/migrate_plus/authentication/OAuth2.php
+1
-1
src/Plugin/migrate_plus/data_fetcher/Http.php
src/Plugin/migrate_plus/data_fetcher/Http.php
+2
-2
tests/src/Kernel/MigrateTableTest.php
tests/src/Kernel/MigrateTableTest.php
+32
-4
tests/src/Kernel/MigrationConfigEntityTest.php
tests/src/Kernel/MigrationConfigEntityTest.php
+8
-0
tests/src/Kernel/MigrationGroupTest.php
tests/src/Kernel/MigrationGroupTest.php
+33
-25
tests/src/Kernel/Plugin/migrate/process/EntityGenerateTest.php
.../src/Kernel/Plugin/migrate/process/EntityGenerateTest.php
+2
-2
tests/src/Kernel/Plugin/migrate_plus/data_fetcher/HttpTest.php
.../src/Kernel/Plugin/migrate_plus/data_fetcher/HttpTest.php
+1
-1
tests/src/Unit/process/StrReplaceTest.php
tests/src/Unit/process/StrReplaceTest.php
+0
-1
No files found.
migrate_example/migrate_example_setup/migrate_example_setup.install
View file @
7a526044
...
...
@@ -2,11 +2,16 @@
/**
* @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
()
{
$schema
[
'migrate_example_beer_account'
]
=
migrate_example_beer_schema_account
();
$schema
[
'migrate_example_beer_node'
]
=
migrate_example_beer_schema_node
();
...
...
@@ -17,6 +22,9 @@ function migrate_example_setup_schema() {
return
$schema
;
}
/**
* Implements hook_install().
*/
function
migrate_example_setup_install
()
{
// Populate our tables.
migrate_example_beer_data_account
();
...
...
@@ -26,6 +34,12 @@ function migrate_example_setup_install() {
migrate_example_beer_data_topic_node
();
}
/**
* The hook_schema definition for node.
*
* @return array
* The schema definition.
*/
function
migrate_example_beer_schema_node
()
{
return
[
'description'
=>
'Beers of the world.'
,
...
...
@@ -92,6 +106,12 @@ function migrate_example_beer_schema_node() {
];
}
/**
* The hook_schema definition for topic.
*
* @return array
* The schema definition.
*/
function
migrate_example_beer_schema_topic
()
{
return
[
'description'
=>
'Categories'
,
...
...
@@ -129,6 +149,12 @@ function migrate_example_beer_schema_topic() {
];
}
/**
* The hook_schema definition for topic node.
*
* @return array
* The schema definition.
*/
function
migrate_example_beer_schema_topic_node
()
{
return
[
'description'
=>
'Beers topic pairs.'
,
...
...
@@ -149,6 +175,12 @@ function migrate_example_beer_schema_topic_node() {
];
}
/**
* The hook_schema definition for comment.
*
* @return array
* The schema definition.
*/
function
migrate_example_beer_schema_comment
()
{
return
[
'description'
=>
'Beers comments.'
,
...
...
@@ -202,6 +234,12 @@ function migrate_example_beer_schema_comment() {
];
}
/**
* The hook_schema definition for account.
*
* @return array
* The schema definition.
*/
function
migrate_example_beer_schema_account
()
{
return
[
'description'
=>
'Beers accounts.'
,
...
...
@@ -262,16 +300,63 @@ function migrate_example_beer_schema_account() {
];
}
/**
* Populate node table.
*/
function
migrate_example_beer_data_node
()
{
$fields
=
[
'bid'
,
'name'
,
'body'
,
'excerpt'
,
'countries'
,
'aid'
,
'image'
,
'image_alt'
,
'image_title'
,
'image_description'
];
$fields
=
[
'bid'
,
'name'
,
'body'
,
'excerpt'
,
'countries'
,
'aid'
,
'image'
,
'image_alt'
,
'image_title'
,
'image_description'
,
];
$query
=
db_insert
(
'migrate_example_beer_node'
)
->
fields
(
$fields
);
// Use high bid numbers to avoid overwriting an existing node id.
$data
=
[
[
99999999
,
'Heineken'
,
'Blab Blah Blah Green'
,
'Green'
,
'Netherlands|Belgium'
,
0
,
'heineken.jpg'
,
'Heinekin alt'
,
'Heinekin title'
,
'Heinekin description'
],
// comes with migrate_example project.
[
99999998
,
'Miller Lite'
,
'We love Miller Brewing'
,
'Tasteless'
,
'USA|Canada'
,
1
,
NULL
,
NULL
,
NULL
,
NULL
],
[
99999997
,
'Boddington'
,
'English occasionally get something right'
,
'A treat'
,
'United Kingdom'
,
1
,
NULL
,
NULL
,
NULL
,
NULL
],
// Comes with migrate_example project.
[
99999999
,
'Heineken'
,
'Blab Blah Blah Green'
,
'Green'
,
'Netherlands|Belgium'
,
0
,
'heineken.jpg'
,
'Heinekin alt'
,
'Heinekin title'
,
'Heinekin description'
,
],
[
99999998
,
'Miller Lite'
,
'We love Miller Brewing'
,
'Tasteless'
,
'USA|Canada'
,
1
,
NULL
,
NULL
,
NULL
,
NULL
,
],
[
99999997
,
'Boddington'
,
'English occasionally get something right'
,
'A treat'
,
'United Kingdom'
,
1
,
NULL
,
NULL
,
NULL
,
NULL
,
],
];
foreach
(
$data
as
$row
)
{
$query
->
values
(
array_combine
(
$fields
,
$row
));
...
...
@@ -280,18 +365,65 @@ function migrate_example_beer_data_node() {
}
/**
* Populate account table.
*
* Note that alice has duplicate username. Exercises dedupe_entity plugin.
*
@
TODO duplicate email also.
*
TODO duplicate email also.
*/
function
migrate_example_beer_data_account
()
{
$fields
=
[
'status'
,
'registered'
,
'username'
,
'nickname'
,
'password'
,
'email'
,
'sex'
,
'beers'
];
$fields
=
[
'status'
,
'registered'
,
'username'
,
'nickname'
,
'password'
,
'email'
,
'sex'
,
'beers'
,
];
$query
=
db_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'
],
[
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
));
...
...
@@ -299,6 +431,9 @@ function migrate_example_beer_data_account() {
$query
->
execute
();
}
/**
* Populate comment table.
*/
function
migrate_example_beer_data_comment
()
{
$fields
=
[
'bid'
,
'cid_parent'
,
'subject'
,
'body'
,
'name'
,
'mail'
,
'aid'
];
$query
=
db_insert
(
'migrate_example_beer_comment'
)
...
...
@@ -308,7 +443,15 @@ function migrate_example_beer_data_comment() {
[
99999998
,
NULL
,
'im second'
,
'aromatic'
,
'alice'
,
'alice@example.com'
,
0
],
[
99999999
,
NULL
,
'im parent'
,
'malty'
,
'alice'
,
'alice@example.com'
,
0
],
[
99999999
,
1
,
'im child'
,
'cold body'
,
'bob'
,
NULL
,
1
],
[
99999999
,
4
,
'im grandchild'
,
'bitter body'
,
'charlie@example.com'
,
NULL
,
1
],
[
99999999
,
4
,
'im grandchild'
,
'bitter body'
,
'charlie@example.com'
,
NULL
,
1
,
],
];
foreach
(
$data
as
$row
)
{
$query
->
values
(
array_combine
(
$fields
,
$row
));
...
...
@@ -316,6 +459,9 @@ function migrate_example_beer_data_comment() {
$query
->
execute
();
}
/**
* Populate topic table.
*/
function
migrate_example_beer_data_topic
()
{
$fields
=
[
'style'
,
'details'
,
'style_parent'
,
'region'
,
'hoppiness'
];
$query
=
db_insert
(
'migrate_example_beer_topic'
)
...
...
@@ -323,7 +469,13 @@ function migrate_example_beer_data_topic() {
$data
=
[
[
'ale'
,
'traditional'
,
NULL
,
'Medieval British Isles'
,
'Medium'
],
[
'red ale'
,
'colorful'
,
'ale'
,
NULL
,
NULL
],
[
'pilsner'
,
'refreshing'
,
NULL
,
'Pilsen, Bohemia (now Czech Republic)'
,
'Low'
],
[
'pilsner'
,
'refreshing'
,
NULL
,
'Pilsen, Bohemia (now Czech Republic)'
,
'Low'
,
],
];
foreach
(
$data
as
$row
)
{
$query
->
values
(
array_combine
(
$fields
,
$row
));
...
...
@@ -331,6 +483,9 @@ function migrate_example_beer_data_topic() {
$query
->
execute
();
}
/**
* Populate topic node table.
*/
function
migrate_example_beer_data_topic_node
()
{
$fields
=
[
'bid'
,
'style'
];
$query
=
db_insert
(
'migrate_example_beer_topic_node'
)
...
...
migrate_example/src/Plugin/migrate/source/BeerComment.php
View file @
7a526044
...
...
@@ -17,9 +17,18 @@ class BeerComment extends SqlBase {
* {@inheritdoc}
*/
public
function
query
()
{
$fields
=
[
'cid'
,
'cid_parent'
,
'name'
,
'mail'
,
'aid'
,
'body'
,
'bid'
,
'subject'
,
];
$query
=
$this
->
select
(
'migrate_example_beer_comment'
,
'mec'
)
->
fields
(
'mec'
,
[
'cid'
,
'cid_parent'
,
'name'
,
'mail'
,
'aid'
,
'body'
,
'bid'
,
'subject'
])
->
fields
(
'mec'
,
$fields
)
->
orderBy
(
'cid_parent'
,
'ASC'
);
return
$query
;
}
...
...
migrate_example/src/Plugin/migrate/source/BeerNode.php
View file @
7a526044
...
...
@@ -18,21 +18,29 @@ class BeerNode extends SqlBase {
* {@inheritdoc}
*/
public
function
query
()
{
/**
* An important point to note is that your query *must* return a single row
* for each item to be imported. Here we might be tempted to add a join to
* migrate_example_beer_topic_node in our query, to pull in the
* relationships to our categories. Doing this would cause the query to
* return multiple rows for a given node, once per related value, thus
* processing the same node multiple times, each time with only one of the
* multiple values that should be imported. To avoid that, we simply query
* the base node data here, and pull in the relationships in prepareRow()
* below.
*/
// An important point to note is that your query *must* return a single row
// for each item to be imported. Here we might be tempted to add a join to
// migrate_example_beer_topic_node in our query, to pull in the
// relationships to our categories. Doing this would cause the query to
// return multiple rows for a given node, once per related value, thus
// processing the same node multiple times, each time with only one of the
// multiple values that should be imported. To avoid that, we simply query
// the base node data here, and pull in the relationships in prepareRow()
// below.
$fields
=
[
'bid'
,
'name'
,
'body'
,
'excerpt'
,
'aid'
,
'countries'
,
'image'
,
'image_alt'
,
'image_title'
,
'image_description'
,
];
$query
=
$this
->
select
(
'migrate_example_beer_node'
,
'b'
)
->
fields
(
'b'
,
[
'bid'
,
'name'
,
'body'
,
'excerpt'
,
'aid'
,
'countries'
,
'image'
,
'image_alt'
,
'image_title'
,
'image_description'
]);
->
fields
(
'b'
,
$fields
);
return
$query
;
}
...
...
@@ -76,11 +84,9 @@ class BeerNode extends SqlBase {
* {@inheritdoc}
*/
public
function
prepareRow
(
Row
$row
)
{
/**
* As explained above, we need to pull the style relationships into our
* source row here, as an array of 'style' values (the unique ID for
* the beer_term migration).
*/
// As explained above, we need to pull the style relationships into our
// source row here, as an array of 'style' values (the unique ID for
// the beer_term migration).
$terms
=
$this
->
select
(
'migrate_example_beer_topic_node'
,
'bt'
)
->
fields
(
'bt'
,
[
'style'
])
->
condition
(
'bid'
,
$row
->
getSourceProperty
(
'bid'
))
...
...
migrate_example/src/Plugin/migrate/source/BeerTerm.php
View file @
7a526044
...
...
@@ -5,11 +5,12 @@ namespace Drupal\migrate_example\Plugin\migrate\source;
use
Drupal\migrate\Plugin\migrate\source\SqlBase
;
/**
* This is an example of a simple SQL-based source plugin. Source plugins are
* classes which deliver source data to the processing pipeline. For SQL
* sources, the SqlBase class provides most of the functionality needed - for
* a specific migration, you are required to implement the three simple public
* methods you see below.
* This is an example of a simple SQL-based source plugin.
*
* Source plugins are classes which deliver source data to the processing
* pipeline. For SQL sources, the SqlBase class provides most of the
* functionality needed - for a specific migration, you are required to
* implement the three simple public methods you see below.
*
* This annotation tells Drupal that the name of the MigrateSource plugin
* implemented by this class is "beer_term". This is the name that the migration
...
...
@@ -25,16 +26,15 @@ class BeerTerm extends SqlBase {
* {@inheritdoc}
*/
public
function
query
()
{
/**
* The most important part of a SQL source plugin is the SQL query to
* retrieve the data to be imported. Note that the query is not executed
* here - the migration process will control execution of the query. Also
* note that it is constructed from a $this->select() call - this ensures
* that the query is executed against the database configured for this
* source plugin.
*/
// The most important part of a SQL source plugin is the SQL query to
// retrieve the data to be imported. Note that the query is not executed
// here - the migration process will control execution of the query. Also
// note that it is constructed from a $this->select() call - this ensures
// that the query is executed against the database configured for this
// source plugin.
$fields
=
[
'style'
,
'details'
,
'style_parent'
,
'region'
,
'hoppiness'
];
return
$this
->
select
(
'migrate_example_beer_topic'
,
'met'
)
->
fields
(
'met'
,
[
'style'
,
'details'
,
'style_parent'
,
'region'
,
'hoppiness'
]
)
->
fields
(
'met'
,
$fields
)
// We sort this way to ensure parent terms are imported first.
->
orderBy
(
'style_parent'
,
'ASC'
);
}
...
...
@@ -43,12 +43,10 @@ class BeerTerm extends SqlBase {
* {@inheritdoc}
*/
public
function
fields
()
{
/**
* This method simply documents the available source fields provided by
* the source plugin, for use by front-end tools. It returns an array keyed
* by field/column name, with the value being a translated string explaining
* to humans what the field represents. You should always
*/
// This method simply documents the available source fields provided by the
// source plugin, for use by front-end tools. It returns an array keyed by
// field/column name, with the value being a translated string explaining
// to humans what the field represents.
$fields
=
[
'style'
=>
$this
->
t
(
'Beer style'
),
'details'
=>
$this
->
t
(
'Style details'
),
...
...
@@ -66,14 +64,12 @@ class BeerTerm extends SqlBase {
* {@inheritdoc}
*/
public
function
getIds
()
{
/**
* This method indicates what field(s) from the source row uniquely identify
* that source row, and what their types are. This is critical information
* for managing the migration. The keys of the returned array are the field
* names from the query which comprise the unique identifier. The values are
* arrays indicating the type of the field, used for creating compatible
* columns in the map tables that track processed items.
*/
// This method indicates what field(s) from the source row uniquely identify
// that source row, and what their types are. This is critical information
// for managing the migration. The keys of the returned array are the field
// names from the query which comprise the unique identifier. The values are
// arrays indicating the type of the field, used for creating compatible
// columns in the map tables that track processed items.
return
[
'style'
=>
[
'type'
=>
'string'
,
...
...
migrate_example/src/Plugin/migrate/source/BeerUser.php
View file @
7a526044
...
...
@@ -18,9 +18,19 @@ class BeerUser extends SqlBase {
* {@inheritdoc}
*/
public
function
query
()
{
$fields
=
[
'aid'
,
'status'
,
'registered'
,
'username'
,
'nickname'
,
'password'
,
'email'
,
'sex'
,
'beers'
,
];
return
$this
->
select
(
'migrate_example_beer_account'
,
'mea'
)
->
fields
(
'mea'
,
[
'aid'
,
'status'
,
'registered'
,
'username'
,
'nickname'
,
'password'
,
'email'
,
'sex'
,
'beers'
]);
->
fields
(
'mea'
,
$fields
);
}
/**
...
...
@@ -58,27 +68,22 @@ class BeerUser extends SqlBase {
* {@inheritdoc}
*/
public
function
prepareRow
(
Row
$row
)
{
/**
* prepareRow() is the most common place to perform custom run-time
* processing that isn't handled by an existing process plugin. It is called
* when the raw data has been pulled from the source, and provides the
* opportunity to modify or add to that data, creating the canonical set of
* source data that will be fed into the processing pipeline.
*
* In our particular case, the list of a user's favorite beers is a pipe-
* separated list of beer IDs. The processing pipeline deals with arrays
* representing multi-value fields naturally, so we want to explode that
* string to an array of individual beer IDs.
*/
// A prepareRow() is the most common place to perform custom run-time
// processing that isn't handled by an existing process plugin. It is called
// when the raw data has been pulled from the source, and provides the
// opportunity to modify or add to that data, creating the canonical set of
// source data that will be fed into the processing pipeline.
// In our particular case, the list of a user's favorite beers is a pipe-
// separated list of beer IDs. The processing pipeline deals with arrays
// representing multi-value fields naturally, so we want to explode that
// string to an array of individual beer IDs.
if
(
$value
=
$row
->
getSourceProperty
(
'beers'
))
{
$row
->
setSourceProperty
(
'beers'
,
explode
(
'|'
,
$value
));
}
/**
* Always call your parent! Essential processing is performed in the base
* class. Be mindful that prepareRow() returns a boolean status - if FALSE
* that indicates that the item being processed should be skipped. Unless
* we're deciding to skip an item ourselves, let the parent class decide.
*/
// Always call your parent! Essential processing is performed in the base
// class. Be mindful that prepareRow() returns a boolean status - if FALSE
// that indicates that the item being processed should be skipped. Unless
// we're deciding to skip an item ourselves, let the parent class decide.
return
parent
::
prepareRow
(
$row
);
}
...
...
migrate_example_advanced/migrate_example_advanced.install
View file @
7a526044
...
...
@@ -2,20 +2,20 @@
/**
* @file
* Install, update and uninstall functions for
the
migrate_example_advanced module.
* Install, update and uninstall functions for migrate_example_advanced module.
*/
use
Drupal\migrate_plus
\
Entity\Migration
;
/**
* Implements hook_install().
*
* We need the urls to be absolute for the XML source plugin to read them, but
* the static configuration files on disk can't know the server and port to
* use. So, in the .yml files we provide the REST resources relative to the
* site root and here rewrite them to fully-qualified paths.
*/
function
migrate_example_advanced_install
()
{
// We need the urls to be absolute for the XML source plugin to read them, but
// the static configuration files on disk can't know the server and port to
// use. So, in the .yml files we provide the REST resources relative to the
// site root and here rewrite them to fully-qualified paths.
/** @var \Drupal\migrate_plus\Entity\MigrationInterface $wine_role_xml_migration */
$wine_role_xml_migration
=
Migration
::
load
(
'wine_role_xml'
);
if
(
$wine_role_xml_migration
)
{
...
...
migrate_example_advanced/migrate_example_advanced_setup/migrate_example_advanced_setup.install
View file @
7a526044
...
...
@@ -55,6 +55,12 @@ function migrate_example_advanced_setup_install() {
migrate_example_advanced_data_table_source
();
}
/**
* The hook_schema definition for wine.
*
* @return array
* The schema definition.
*/
function
migrate_example_advanced_schema_wine
()
{
return
[
'description'
=>
'Wines of the world'
,
...
...
@@ -123,6 +129,12 @@ function migrate_example_advanced_schema_wine() {
];
}
/**
* The hook_schema definition for updates.
*
* @return array
* The schema definition.
*/
function
migrate_example_advanced_schema_updates
()
{
return
[
'description'
=>
'Updated wine ratings'
,
...
...
@@ -144,6 +156,12 @@ function migrate_example_advanced_schema_updates() {
];
}
/**
* The hook_schema definition for producer.
*
* @return array
* The schema definition.
*/
function
migrate_example_advanced_schema_producer
()
{
return
[
'description'
=>
'Wine producers of the world'
,
...
...
@@ -182,6 +200,12 @@ function migrate_example_advanced_schema_producer() {
];
}
/**
* The hook_schema definition for categories.
*
* @return array
* The schema definition.
*/
function
migrate_example_advanced_schema_categories
()
{
return
[
'description'
=>
'Categories'
,
...
...
@@ -225,6 +249,12 @@ function migrate_example_advanced_schema_categories() {
];
}
/**
* The hook_schema definition for vintages.
*