Created
August 31, 2017 22:45
-
-
Save zackify/41b2ef522ac36c7601a72f98af7df6b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const beforeInsert = ({ values, state }) => { | |
if(state.deleted) values.deleted_at = Date.now() | |
return values | |
} | |
const conversions = { | |
column_one: ({value, setState}) => { | |
if(value.match(/zz/)) setState({ deleted: true}) | |
return value.replace('zz','') | |
} | |
} | |
export default { | |
from: 'table', | |
to: 'newtable', | |
beforeInsert, | |
conversions, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment