Skip to content

dbmover/data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dbmover\Data

DbMover plugin to execute data-altering statements (INSERT, UPDATE, DELETE) on migration.

Installation

$ composer require dbmover/data

Usage

For general DbMover usage, see dbmover/core.

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.

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).

Or you could include something like this in your schema:

``sql INSERT INTO bar (id, bar) SELECT id, foo FROM foo WHERE id NOT IN (SELECT id FROM bar);


## Contributing
See `dbmover/core`.

About

Dbmover plugin for explicitly running data modification statements after migration

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages