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

Commit aa00d74f by Sushant Committed by Felix Becker

fix mssql

1 parent be7dbe56
Showing with 10 additions and 0 deletions
...@@ -27,15 +27,25 @@ describe(Support.getTestDialectTeaser('QueryInterface'), function() { ...@@ -27,15 +27,25 @@ describe(Support.getTestDialectTeaser('QueryInterface'), function() {
describe('dropAllTables', function() { describe('dropAllTables', function() {
it('should drop all tables', function() { it('should drop all tables', function() {
function filterMSSQLDefault(tableNames) {
return tableNames.filter(function (t) {
return t.tableName !== 'spt_values';
});
}
var self = this; var self = this;
return this.queryInterface.dropAllTables().then(function() { return this.queryInterface.dropAllTables().then(function() {
return self.queryInterface.showAllTables().then(function(tableNames) { return self.queryInterface.showAllTables().then(function(tableNames) {
// MSSQL include spt_values table which is system defined, hence cant be dropped
tableNames = filterMSSQLDefault(tableNames);
expect(tableNames).to.be.empty; expect(tableNames).to.be.empty;
return self.queryInterface.createTable('table', { name: DataTypes.STRING }).then(function() { return self.queryInterface.createTable('table', { name: DataTypes.STRING }).then(function() {
return self.queryInterface.showAllTables().then(function(tableNames) { return self.queryInterface.showAllTables().then(function(tableNames) {
tableNames = filterMSSQLDefault(tableNames);
expect(tableNames).to.have.length(1); expect(tableNames).to.have.length(1);
return self.queryInterface.dropAllTables().then(function() { return self.queryInterface.dropAllTables().then(function() {
return self.queryInterface.showAllTables().then(function(tableNames) { return self.queryInterface.showAllTables().then(function(tableNames) {
// MSSQL include spt_values table which is system defined, hence cant be dropped
tableNames = filterMSSQLDefault(tableNames);
expect(tableNames).to.be.empty; expect(tableNames).to.be.empty;
}); });
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!