Delete schemas tables data.

@param {[Schemas]} schemas
@return {Promise}
423076
function reset(schemas) {
  var resolver = new Resolver(schemas);
  // Reduce force sequential execution.
  return Promise.reduce(resolver.resolve().reverse(), resetSchema.bind(this), []);
}
1284561
function schema (args) {
    // get args object
    args = requireValidOptionalObject(args)
    // get colunmn and index information from database
    return Promise.all([
        this.mysql().query(sql.describe(this)),
        this.mysql().query(sql.showCreateTable(this)),
        this.mysql().query(sql.showIndexes(this)),
    ])
    // build schema from database response
    .then(res => {
        // get columns and indexes from describe and show index queries
        var columns = res[0][0]
        var createTable = res[1][0]
        var indexes = res[2][0]
        // schema data
        var schema = {
            columns: {},
            indexes: [],
        }
        // get first and only create table record
        createTable = _.get(createTable, "[0]['Create Table']", '')
        // get engine and charset from create table sql
        var engine = createTable.match(/ENGINE=(\w+)/)
        schema.engine = engine && engine[1] || ''
        var charset = createTable.match(/DEFAULT CHARSET=(\w+)/)
        schema.charset = charset && charset[1] || ''
        // build column data
        _.each(columns, dbColumn => {
            var column = schema.columns[dbColumn.Field] = {}
            // check unsigned
            if (dbColumn.Type.match(/unsigned$/)) {
                column.unsigned = true
                dbColumn.Type = dbColumn.Type.replace(/ unsigned/, '')
            }
            // char id column
            if (dbColumn.Type === 'char(32)') {
                // model must not be set for binary ids
                assert.ok(this.binaryIds === false, 'binaryIds must be disabled for char id columns')
                // set type
                column.type = 'id'
            }
            // binary id column
            else if (dbColumn.Type === 'binary(16)') {
                // model must be set for binary ids
                assert.ok(this.binaryIds === true, 'binaryIds must be enabled for binary id columns')
                // set type
                column.type = 'id'
            }
            // all other column types
            else  {
                // require valid type
                assert.ok(sql.columnTypesInverse[dbColumn.Type], 'unrecognized column type '+dbColumn.Type)
                // map database to internal type
                column.type = sql.columnTypesInverse[dbColumn.Type]
            }
            // is column nullable
            if (dbColumn.Null === 'NO') {
                column.null = false
            }
            // set default if not null
            if (dbColumn.Default) {
                column.default = dbColumn.Default
                // convert boolean
                if (column.type === 'boolean') {
                    column.default = column.default === '1' ? true : false
                }
            }
        })
        // map of indexes by key name since keys may cover multiple columns
        var indexesByKey = {}
        // build map of indexes by key name
        _.each(indexes, dbIndex => {
            // create entry for index if it does not already exist
            if (!indexesByKey[dbIndex.Key_name]) {
                indexesByKey[dbIndex.Key_name] = {
                    columns: {}
                }
            }
            // get entry for index
            var index = indexesByKey[dbIndex.Key_name]
            // add column with sequence in index
            index.columns[dbIndex.Column_name] = parseInt(dbIndex.Seq_in_index)
            // add unique flag if true
            if (dbIndex.Non_unique === '0') {
                index.unique = true
            }
        })
        // add indexes to schema
        _.each(indexesByKey, (index, name) => {
            var indexColumns = _.keys(index.columns)
            // multi-column index
            if (indexColumns.length > 1) {
                // sort index columns by the Seq_in_index value - these may
                // always be in order so this may not be needed
                indexColumns = _.sortBy(indexColumns, indexColumn => index.columns[indexColumn])
                // create schema index entry
                var schemaIndex = {
                    columns: indexColumns,
                }
                // set unique flag
                if (index.unique) {
                    schemaIndex.unique = true
                }
                // add index to schema
                schema.indexes.push(schemaIndex)
            }
            // single column index
            else {
                // get first and only column
                var indexColumn = indexColumns[0]
                // PRIMARY KEY
                if (name === 'PRIMARY') {
                    schema.columns[indexColumn].primary = true
                }
                // unique index
                else if (index.unique) {
                    schema.columns[indexColumn].unique = true
                }
                // non-unique index
                else {
                    schema.columns[indexColumn].index = true
                }
            }
        })
        // resolve with schema
        return schema
    })
    .catch(err => {
        // reject on anything besides a table does not exist error
        // if table does not exist resolve with undefined
        if (err.errno !== 1146) {
            throw err
        }
    })
}
1022143
def qs_delete(self, *keys):
        ''''''
        query = self.query.copy()
        for key in set(keys):
            try:
                del query[key]
            except KeyError:
                pass
        return self._copy(query=query)
147607
def delete(sql_params = "", *bindvars)
      delete_sql = "DELETE FROM \"#{@schema_name}\".\"#{@table_name}\" "
      case sql_params
      when String
        delete_sql << sql_params
      when Hash
        raise ArgumentError, "Cannot specify bind variables when passing WHERE conditions as Hash" unless bindvars.empty?
        where_sqls = []
        sql_params.each do |k, v|
          where_sqls << "#{k} = :#{k}"
          bindvars << v
        end
        delete_sql << "WHERE " << where_sqls.join(" AND ") unless where_sqls.empty?
      else
        raise ArgumentError, "Only String or Hash can be provided as SQL condition argument"
      end
      @schema.execute(delete_sql, *bindvars)
    end
122876
def _filter_schemas(schemas, schema_tables, exclude_table_columns):
    """"""
    return [_filter_schema(s, schema_tables, exclude_table_columns)
            for s in schemas]
199368
function filterSchemas(schemas, tableNames, callback) {
  if (! (schemas || []).length || ! (tableNames || []).length)
    return process.nextTick(_.partial(callback, null, schemas || []));

  var schemasMap = _.indexBy(schemas, 'tableName');
  var filteredSchemas = _.chain(schemasMap).pick(tableNames).toArray().value();
  resolveSchemasDeps(filteredSchemas, schemasMap, callback);
}
1144531
public void deleteFromSchema(Mutation mutation, long timestamp)
    {
        ColumnFamily cf = mutation.addOrGet(CFMetaData.SchemaColumnsCf);
        int ldt = (int) (System.currentTimeMillis() / 1000);

        // Note: we do want to use name.toString(), not name.bytes directly for backward compatibility (For CQL3, this won't make a difference).
        Composite prefix = CFMetaData.SchemaColumnsCf.comparator.make(cfName, name.toString());
        cf.addAtom(new RangeTombstone(prefix, prefix.end(), timestamp, ldt));
    }
947675
def update_schemas(self, schemas):
        
        self.schemas.update((_lower(d), _lower(s)) for (d, s) in schemas)
467860
@Override
    public void exportSchema(final String persistenceUnit, List<TableInfo> schemas)
    {
        super.exportSchema(persistenceUnit, schemas);
    }
208930
def delete_hls_profile(apps, schema_editor):
    
    Profile = apps.get_model("edxval", "Profile")
    Profile.objects.filter(profile_name=HLS_PROFILE).delete()
189724
void delete() {
        StringBuilder sql = new StringBuilder();
        sql.append("DROP SCHEMA ");
        sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(this.name));
        if (this.sqlgGraph.getSqlDialect().supportsCascade()) {
            sql.append(" CASCADE");
        }
        if (this.sqlgGraph.getSqlDialect().needsSemicolon()) {
            sql.append(";");
        }
        if (logger.isDebugEnabled()) {
            logger.debug(sql.toString());
        }
        Connection conn = this.sqlgGraph.tx().getConnection();
        try (Statement stmt = conn.createStatement()) {
            stmt.execute(sql.toString());
        } catch (SQLException e) {
            logger.error("schema deletion failed " + this.sqlgGraph.toString(), e);
            throw new RuntimeException(e);
        }
    }
154371
function runMigrations(db, currentVersion) {
  return new Promise((resolve, reject) => {
    const nextVersion = currentVersion + 1;

    if (!migrations[nextVersion]) {
      return resolve();
    }

    if (debug) {
      console.log('Migrating schema to v%d', nextVersion);
    }
    migrations[nextVersion](db)
      .then(() => {
        // write new schemaVersion file
        const json = JSON.stringify({ schemaVersion: nextVersion });
        fs.writeFile(schemaVersionFilePath, json, err => {
          if (err) {
            return reject(err);
          }
          resolve(runMigrations(db, nextVersion));
        });
      })
      .catch(reject);
  });
}
211611
def refresh_schema(self, exclude_system_tables=True, use_cache=False):
        

        col_meta, table_meta = self._get_db_metadata(exclude_system_tables, use_cache)
        tables = self._gen_tables_from_col_tuples(col_meta)

        # Three modes for refreshing schema
        # 1. load directly from cache
        # 2. use a single query for getting all key relationships
        # 3. use the naive approach
        if use_cache:
            # generate our Tables, and load them into a TableSet
            self._tables = TableSet([Table(self.con, self._query_templates, table_meta[t]['schema'], t, tables[t],
                                           keys_per_column=self.keys_per_column,
                                           foreign_keys=table_meta[t]['foreign_keys']['columns'],
                                           ref_keys=table_meta[t]['ref_keys']['columns'])
                                     for t in sorted(tables.keys())])

        # optimize the foreign/ref key query by doing it one time, database-wide, if query is available
        elif not use_cache and isinstance(self._query_templates.get('system', {}).get('foreign_keys_for_db', None), str):

            self.cur.execute(self._query_templates['system']['foreign_keys_for_db'])
            table_db_foreign_keys = defaultdict(list)
            for rel in self.cur:
                # second value in relationship tuple is the table name
                table_db_foreign_keys[rel[1]].append(rel)

            self.cur.execute(self._query_templates['system']['ref_keys_for_db'])
            table_db_ref_keys = defaultdict(list)
            for rel in self.cur:
                # second value in relationship tuple is the table name
                table_db_ref_keys[rel[1]].append(rel)

            # generate our Tables, and load them into a TableSet
            self._tables = TableSet([Table(self.con, self._query_templates, tables[t][0].schema, t, tables[t],
                                           keys_per_column=self.keys_per_column,
                                           foreign_keys=table_db_foreign_keys[t], ref_keys=table_db_ref_keys[t])
                                     for t in sorted(tables.keys())])
        elif not use_cache:
            self._tables = TableSet([Table(self.con, self._query_templates, tables[t][0].schema, t, tables[t],
                                           keys_per_column=self.keys_per_column) for t in sorted(tables.keys())])

        sys.stderr.write("done!\n")
443603
function populate(schemas) {
  var resolver = new Resolver(schemas);
  // Reduce force sequential execution.
  return Promise.reduce(resolver.resolve(), populateSchema.bind(this), []);
}
123775
protected function cleanDatabase(array $tables)
    {
        DB::statement($this->getForeignKeyCheck(false));
        foreach ($tables as $table) {
            if (Schema::hasTable($table)) {
                DB::table($table)->truncate();
            }
        }
        DB::statement($this->getForeignKeyCheck(true));
    }
1159713
def _strip_schema(url):
    """"""
    result = parse_url(url, allow_fragments=False)
    return result.netloc + result.path
400368
async function fetchDatabaseSchemas (client, schemaNames, jsonSchemas, messages) {
  const currentDbStructure = await pgInfo({
    client: client,
    schemas: schemaNames
  })

  const expectedDbStructure = await relationize({
    source: {
      schemas: jsonSchemas
    }
  })

  return {
    currentDbStructure,
    expectedDbStructure
  }
}