Reformat migration script
Add a db test