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

Commit 8e7789e7 by Matt Broadstone

fix schema test and move dropSchema to AbstractDialect

The schema.test.js added yesterday was using before/after in the
test cases when this.sequelize was not guaranteed to be present yet.
This also moves dropSchema to the AbstractDialect, currently the
code simply assumed you had this implemented in your dialect
1 parent 607722a3
......@@ -28,6 +28,13 @@ module.exports = (function() {
},
/*
Returns a query for dropping a schema
*/
dropSchema: function(tableName, options) {
return this.dropTableQuery(tableName, options);
},
/*
Returns a query for creating a table.
Parameters:
- tableName: Name of the new table.
......
......@@ -13,10 +13,6 @@ module.exports = (function() {
return Utils._.template(query)({});
},
dropSchema: function(tableName, options) {
return this.dropTableQuery(tableName, options);
},
showSchemasQuery: function() {
return 'SHOW TABLES';
},
......
......@@ -24,10 +24,6 @@ module.exports = (function() {
return Utils._.template(query)({});
},
dropSchema: function(tableName, options) {
return this.dropTableQuery(tableName, options);
},
showSchemasQuery: function() {
return "SELECT name FROM `sqlite_master` WHERE type='table' and name!='sqlite_sequence';";
},
......
......@@ -8,11 +8,11 @@ var chai = require('chai')
chai.config.includeStack = true;
describe(Support.getTestDialectTeaser('Schema'), function () {
before(function() {
beforeEach(function() {
return this.sequelize.createSchema('testschema');
});
after(function() {
afterEach(function() {
return this.sequelize.dropSchema('testschema');
});
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!