MCPcopy
hub / github.com/sequelize/sequelize / dropTestSchemas

Function dropTestSchemas

test/support.js:158–174  ·  view source on GitHub ↗
(sequelize)

Source from the content-addressed store, hash-verified

156 },
157
158 async dropTestSchemas(sequelize) {
159 const queryInterface = sequelize.getQueryInterface();
160 if (!queryInterface.queryGenerator._dialect.supports.schemas) {
161 return this.sequelize.drop({});
162 }
163
164 const schemas = await sequelize.showAllSchemas();
165 const schemasPromise = [];
166 schemas.forEach(schema => {
167 const schemaName = schema.name ? schema.name : schema;
168 if (schemaName !== sequelize.config.database) {
169 schemasPromise.push(sequelize.dropSchema(schemaName));
170 }
171 });
172
173 await Promise.all(schemasPromise.map(p => p.catch(e => e)));
174 },
175
176 getSupportedDialects() {
177 return fs

Callers

nothing calls this directly

Calls 5

getQueryInterfaceMethod · 0.80
allMethod · 0.80
dropMethod · 0.45
showAllSchemasMethod · 0.45
dropSchemaMethod · 0.45

Tested by

no test coverage detected