Rename this table
348915
@Override
    public ZipkinAnnotations rename(String name) {
        return new ZipkinAnnotations(DSL.name(name), null);
    }
1037329
def rename_item(self, table_name, item_old_name, item_new_name):
        
        # define some helper methods:

        def put_together_if_list(item):
            """
            String joining function
            that doesn't break with None/np.nan
            """
            try:
                res = ":".join(item)
                return ":".join(item)
            except TypeError as ex:
                #print ex
                return item

        def replace_colon_delimited_value(df, col_name, old_value, new_value):
            """
            Col must contain list
            """
            count = 1
            for index, row in df[df[col_name].notnull()].iterrows():
                names_list = row[col_name]
                names_list = [name.strip() for name in names_list]
                try:
                    ind = names_list.index(old_value)
                except ValueError as ex:
                    count += 1
                    continue
                names_list[ind] = new_value
                df.loc[count, col_name] = names_list
                count += 1

        # initialize some things
        item_type = table_name
        ###col_name = item_type[:-1] + "_name"
        col_name = item_type[:-1]
        col_name_plural = col_name + "s"
        table_df = self.tables[item_type].df

        if item_old_name == '':
            # just add a new item
            self.add_item(table_name, {col_name: item_new_name}, item_new_name)
            return

        # rename item in its own table
        table_df.rename(index={item_old_name: item_new_name}, inplace=True)
        # rename in any parent/child tables
        for table_name in self.tables:
            df = self.tables[table_name].df
            col_names = df.columns
            # change anywhere col_name (singular, i.e. site) is found
            if col_name in col_names:
                df[col_name].where(df[col_name] != item_old_name, item_new_name, inplace=True)
                # change anywhere col_name (plural, i.e. sites) is found
            if col_name_plural in col_names:
                df[col_name_plural + "_list"] = df[col_name_plural].str.split(":")
                replace_colon_delimited_value(df, col_name_plural + "_list", item_old_name, item_new_name)
                df[col_name_plural] = df[col_name_plural + "_list"].apply(put_together_if_list)
                df.drop(col_name_plural + "_list", axis=1, inplace=True)
            self.tables[table_name].df = df
711842
def rename(self, name):
        
        self.update(name='{} node {}'.format(name, self.nodeid))
821631
public function renameField($tableName, $oldName, $newName)
    {
        $fieldList = $this->fieldList($tableName);
        if (array_key_exists($oldName, $fieldList)) {
            $this->query("ALTER TABLE \"$tableName\" CHANGE \"$oldName\" \"$newName\" " . $fieldList[$oldName]);
        }
    }
871448
def rename_keys(record: Mapping, key_map: Mapping) -> dict:
    """"""

    new_record = dict()

    for k, v in record.items():
        key = key_map[k] if k in key_map else k
        new_record[key] = v

    return new_record
974524
def delete_table(table_name):
    """"""
    to_delete = [
        make_key(table_name, rec['id'])
        for rec in read_by_indexes(table_name, [])
    ]

    with DatastoreTransaction() as tx:
        tx.get_commit_req().mutation.delete.extend(to_delete)
1062156
def alter_table(table_name, options = {}) #:nodoc:
      table_name = table_name.to_s.downcase
      altered_table_name = "altered_#{table_name}"
      caller = lambda {|definition| yield definition if block_given?}

      transaction do
        # A temporary table might improve performance here, but
        # it doesn't seem to maintain indices across the whole move.
        move_table(table_name, altered_table_name,
          options)
        move_table(altered_table_name, table_name, &caller)
      end
    end
136482
function (name, newName, opts) {
            opts = opts || {};
            this.operations.push(merge({op:"renameColumn", name:name, newName:newName}, opts));
        }
804131
function _rename(){
    self._visitingAlter = true;
    var table = self._queryNode.table;
    var result = ['EXEC sp_rename '+self.visit(table.toNode())+', '+self.visit(alter.nodes[0].nodes[0])];
    self._visitingAlter = false;
    return result;
  }
160853
def setTable( self, table ):
        
        self._table = table
        self.setEnabled(table is not None)
        self.clear()
15328
public function rename_table(xmldb_table $xmldb_table, $newname) {
        // Check newname isn't empty
        if (!$newname) {
            throw new ddl_exception('ddlunknownerror', null, 'newname can not be empty');
        }

        $check = new xmldb_table($newname);

        // Check table already renamed
        if (!$this->table_exists($xmldb_table)) {
            if ($this->table_exists($check)) {
                throw new ddl_exception('ddlunknownerror', null, 'table probably already renamed');
            } else {
                throw new ddl_table_missing_exception($xmldb_table->getName());
            }
        }

        // Check new table doesn't exist
        if ($this->table_exists($check)) {
            throw new ddl_exception('ddltablealreadyexists', $check->getName(), 'can not rename table');
        }

        if (!$sqlarr = $this->generator->getRenameTableSQL($xmldb_table, $newname)) {
            throw new ddl_exception('ddlunknownerror', null, 'table rename sql not generated');
        }

        $this->execute_sql_arr($sqlarr);
    }
317484
def rename(mapping)
      new_attributes = map do |attr|
        alias_name = mapping[attr.name]
        alias_name ? attr.aliased(alias_name) : attr
      end

      new(new_attributes)
    end
1030912
public function renameTable($table, $newName)
	{
		echo "    > rename table $table to $newName ...";
		$time=microtime(true);
		$this->getDbConnection()->createCommand()->renameTable($table, $newName);
		echo " done (time: ".sprintf('%.3f', microtime(true)-$time)."s)\n";
	}
931198
public function renameTable($table, $name)
    {
        //Argument 1 must be a string, 2 must be string
        Argument::i()->test(1, 'string')->argument(2, 'string');
        
        $this->query = 'RENAME TABLE `' . $table . '` TO `' . $name . '`';
        return $this;
    }
962086
public function change()
    {
        $tableName = 'language_translations';
        if (!$this->hasTable($tableName)) {
            $tableName = 'translations';
        }

        $table = $this->table($tableName);
        if ($table->hasColumn('created')) {
            $table->changeColumn('created', 'datetime', [
                'default' => null,
                'null' => true
            ]);
        }
        if ($table->hasColumn('modified')) {
            $table->changeColumn('modified', 'datetime', [
                'default' => null,
                'null' => true
            ]);
        }
        $table->save();
    }
1262492
function rename(key, newkey, req) {
  var val = this.getKey(key);
  this.delKey(key);
  this.setKey(newkey, val);
  return OK;
}
937356
def rename_column(old, nu)
      col = @origin.columns[old.to_s]

      definition = col[:type]
      definition += ' NOT NULL' unless col[:is_nullable]
      definition += " DEFAULT #{@connection.quote(col[:column_default])}" if col[:column_default]

      ddl('alter table `%s` change column `%s` `%s` %s' % [@name, old, nu, definition])
      @renames[old.to_s] = nu.to_s
    end