1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-09 00:18:00 +01:00

revert schema reset for each migration

This commit is contained in:
sveisvei 2016-11-13 16:14:51 +01:00 committed by Ivar Conradi Østhus
parent 6d6f862bd1
commit c8746b85f7
2 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@
"test:pg-virtualenv": "pg_virtualenv npm run test:pg-virtualenv-chai", "test:pg-virtualenv": "pg_virtualenv npm run test:pg-virtualenv-chai",
"test:pg-virtualenv-chain": "export TEST_DATABASE_URL=postgres://$PGUSER:$PGPASSWORD@localhost:$PGPORT/postgres ; npm run db-migrate-testdb && npm test", "test:pg-virtualenv-chain": "export TEST_DATABASE_URL=postgres://$PGUSER:$PGPASSWORD@localhost:$PGPORT/postgres ; npm run db-migrate-testdb && npm test",
"test:coverage": "nyc npm run test", "test:coverage": "nyc npm run test",
"test:coverage-report": "nyc report --reporter=text-lcov | coveralls && rm -rf ./coverage" "test:coverage-report": "nyc report --reporter=text-lcov | coveralls"
}, },
"dependencies": { "dependencies": {
"body-parser": "1.15.2", "body-parser": "1.15.2",

View File

@ -20,7 +20,7 @@ function createApp (databaseSchema = 'test') {
}; };
const db = createDb({ databaseUri: options.databaseUri, minPool: 0, maxPool: 0 }); const db = createDb({ databaseUri: options.databaseUri, minPool: 0, maxPool: 0 });
return db.raw(`DROP SCHEMA IF EXISTS ${options.databaseSchema} CASCADE; CREATE SCHEMA ${options.databaseSchema}`) return db.raw(`CREATE SCHEMA IF NOT EXISTS ${options.databaseSchema}`)
.then(() => migrator(options)) .then(() => migrator(options))
.then(() => { .then(() => {
db.destroy(); db.destroy();