Dbmover\Data
DbMover plugin to execute data-altering statements (INSERT, UPDATE,
DELETE) on migration., (*1)
Installation
$ composer require dbmover/data
Usage
For general DbMover usage, see dbmover/core., (*2)
This plugin extracts and executes all data-altering statements from your schema
file. Typically, this will be the last plugin you'll want to add., (*3)
Example
Say you have a table foo in your schema, with many rows. You now add a table
bar in a migration, and your application requires that it contains a row for
each row in foo (perhaps you're doing a straight join in the new version
somewhere). You could of course "remember" to perform that insert after
migration, but that sucks (and people will forget)., (*4)
Or you could include something like this in your schema:, (*5)
``sql
INSERT INTO bar (id, bar) SELECT id, foo FROM foo WHERE id NOT IN
(SELECT id FROM bar);
```, (*6)
Contributing
See dbmover/core., (*7)