function analyzeFields(table, config) { return queryInterface.describeTable(table, { schema: config.dbSchema }); }
const description = dynamoDB.describeTable(params, function(errDesc, dataDesc) { if (errDesc) { console.error("THERE IS A BIG PROBLEM! SEEMS THAT THE TABLE WHICH MUST CONTAIN THE MODEL DOESN'T EXIST: ", errDesc);
function exportSchema(tableName, file, region, endpoint) { const dynamoDb = new AWS.DynamoDB({ region }); if (endpoint) dynamoDb.endpoint = endpoint; return dynamoDb.describeTable({ TableName: tableName }).promise() .then(data => { const table = data.Table; const file2 = file || sanitizeFilename(tableName + '.dynamoschema'); return fs.writeFileAsync(file2, JSON.stringify(table, null, 2)) }); }
qi.describeTable(TBL) .then((attributes) => { attr = attributes; if (!attr.hasOwnProperty('settings')) { return qi.addColumn(TBL, 'settings', { type: Sequelize.JSON, allowNull: true, }); } return true; })
qi.sequelize.transaction( () => qi.describeTable(table) .then((described) => attributes = described) .then(() => attributes.hasOwnProperty(ca)) .then((colExists) => colExists ? true : addCol(qi, ca, opts)) .then(() => attributes.hasOwnProperty(ga)) .then((colExists) => colExists ? true : addCol(qi, ga, opts)) .then(() => attributes.hasOwnProperty(gta)) .then((colExists) => colExists ? true : addCol(qi, gta, opts)) )
const verifyMocks = (t) => { t.context.dynamodb.createTable.verify(); t.context.dynamodb.describeTable.verify(); }
up(qi /* , Sequelize */) { return qi.describeTable(TBL) .then((attributes) => ('createdAt' in attributes)) .then((hasCreatedAtField) => { if (!hasCreatedAtField) { return qi.dropTable(TBL); } return true; }); }
client.describeTable(params, function (err, data) { if (err) { console.log('error:', err); return; } console.log('success:', data); });
qi.describeTable(TBL) .then((attributes) => { attr = attributes; if (attr.hasOwnProperty('settings')) { return qi.removeColumn(TBL, 'settings'); } return true; })
qi.describeTable(TBL) .then((attributes) => { attr = attributes; if (!attr.hasOwnProperty('bots')) { return qi.addColumn(TBL, 'bots', { type: Sequelize.ARRAY(Sequelize.STRING), allowNull: true, }); } return true; })
qi.describeTable(TBL) .then((attributes) => { attr = attributes; if (!attr.hasOwnProperty('settings')) { return qi.addColumn(TBL, 'settings', { type: Sequelize.ARRAY(Sequelize.JSONB), allowNull: true, }); } return true; })
qi.describeTable(TBL) .then((attributes) => { attr = attributes; if (attr.hasOwnProperty('bots')) { return qi.removeColumn(TBL, 'bots'); } return true; })
qi.describeTable(TBL) .then((attributes) => { attr = attributes; if (attr.hasOwnProperty('settings')) { return qi.removeColumn(TBL, 'settings'); } return true; })
qi.describeTable(TBL) .then((attributes) => { attr = attributes; if (!attr.hasOwnProperty('bots')) { return qi.addColumn(TBL, 'bots', { type: Sequelize.ARRAY(Sequelize.STRING), allowNull: true, }); } return true; })
qi.describeTable(TBL) .then((attributes) => { attr = attributes; if (attr.hasOwnProperty('bots')) { return qi.removeColumn(TBL, 'bots'); } return true; })