schema-mapper-optimizer
v0.3.2
Published
Optimize [Changes](https://github.com/schema-mapper/spec#changes)
Downloads
5
Readme
schema-mapper-optimizer
Optimize Changes
Installation
npm install --save schema-mapper-optimizer
Usage
var optimizer = require('schema-mapper-optimizer');
var before = [
{
change: 'schema.create',
projectId: '1',
schemaId: '1',
schema: {
name: 'users',
primary: '1',
columns: {
'1': {
name: 'id',
type: 'uuid'
}
}
}
},
{
change: 'schema.rename',
projectId: '1',
schemaId: '1',
name: 'user',
oldName: 'users'
}
];
var after = optimizer.optimize(before);
console.log('after:', after);
after: [
{
change: 'schema.create',
projectId: '1',
schemaId: '1',
schema: {
name: 'user',
primary: '1',
columns: {
'1': {
name: 'id',
type: 'uuid'
}
}
}
}
]
API docs
Licence
MIT