不要怂,就是干,撸起袖子干!

Commit 3e9d1f7b by Sascha Depold

test for migrations

1 parent 37f47f16
Showing with 27 additions and 0 deletions
......@@ -267,3 +267,30 @@
cd ../../..
}
@test "--migrate creates a SequelizeMeta table" {
cd test/binary/tmp
rm -rf ./*
../../../bin/sequelize -i
cp ../../assets/migrations/*-createPerson.js ./migrations/
cat ../../support.js|sed s,/../,/../../../, > ./support.js
# adjust the config.json
node -e "var ld = require('lodash');var c = require('../../config/config.js'); console.log(JSON.stringify(ld.extend(c, c[process.env.DIALECT || 'mysql'])))" > config/config.json
# drop all the tables
sequelize="global.beforeEach = function(){};\
var Support = require('./support');\
var sequelize = Support.createSequelizeInstance({ dialect: Support.getTestDialect() });\
"
node -e "$sequelize Support.clearDatabase(sequelize, function() {});"
../../../bin/sequelize --migrate
run node -e "$sequelize sequelize.getQueryInterface().showAllTables().success(function(tables){ tables.forEach(function(table){ console.log(table) }) })"
[ $status -eq 0 ]
[ "${lines[0]}" = "Person" ]
[ "${lines[1]}" = "SequelizeMeta" ]
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!