/** * Return the proper SQL for creating or * altering a column. * * Appropriate for use in CREATE TABLE or * ALTER TABLE statements. * * @param ColumnDef $cd column to create * * @return string correct SQL for that column */ function columnSql(array $cd) { $line = array(); $line[] = parent::columnSql($cd); // This'll have been added from our transform of 'serial' type if (!empty($cd['auto_increment'])) { $line[] = 'auto_increment'; } if (!empty($cd['description'])) { $line[] = 'comment'; $line[] = $this->quoteValue($cd['description']); } return implode(' ', $line); }
/** * Return the proper SQL for creating or * altering a column. * * Appropriate for use in CREATE TABLE or * ALTER TABLE statements. * * @param array $cd column to create * * @return string correct SQL for that column */ function columnSql(array $cd) { $line = array(); $line[] = parent::columnSql($cd); /* if ($table['foreign keys'][$name]) { foreach ($table['foreign keys'][$name] as $foreignTable => $foreignColumn) { $line[] = 'references'; $line[] = $this->quoteIdentifier($foreignTable); $line[] = '(' . $this->quoteIdentifier($foreignColumn) . ')'; } } */ return implode(' ', $line); }