schema-mapper-inverter
v0.4.2
Published
Invert changes.
Downloads
6
Readme
schema-mapper-inverter
Invert a set of Changes.
Installation
npm install --save schema-mapper-inverter
Usage
var inverter = require('schema-mapper-inverter');
var changes = [
{
change: 'schema.rename',
projectId: '1',
schemaId: '1',
name: 'users',
oldName: 'user'
},
{
change: 'column.rename',
projectId: '1',
schemaId: '1',
columnId: '1',
name: 'id',
oldName: 'user_id'
}
];
var invertedChanges = inverter.invert(changes);
console.log(invertedChanges);
[
{
change: 'column.rename',
projectId: '1',
schemaId: '1',
columnId: '1',
name: 'user_id',
oldName: 'id'
},
{
change: 'schema.rename',
projectId: '1',
schemaId: '1',
name: 'user',
oldName: 'users'
}
]
API docs
Licence
MIT