updated routing to fix several issues.
This commit is contained in:
@@ -16,9 +16,9 @@ class Postgres extends Grammar {
|
||||
{
|
||||
$columns = implode(', ', $this->columns($table));
|
||||
|
||||
// First we will generate the base table creation statement. Other than
|
||||
// auto-incrementing keys, no indexes will be created during the first
|
||||
// creation of the table. They will be added in separate commands.
|
||||
// First we will generate the base table creation statement. Other than incrementing
|
||||
// keys, no indexes will be created during the first creation of the table since
|
||||
// they will be added in separate commands.
|
||||
$sql = 'CREATE TABLE '.$this->wrap($table).' ('.$columns.')';
|
||||
|
||||
return $sql;
|
||||
@@ -35,9 +35,9 @@ class Postgres extends Grammar {
|
||||
{
|
||||
$columns = $this->columns($table);
|
||||
|
||||
// Once we the array of column definitions, we'll add "add column"
|
||||
// to the front of each definition, then we'll concatenate the
|
||||
// definitions using commas like normal and generate the SQL.
|
||||
// Once we the array of column definitions, we need to add "add" to the front
|
||||
// of each definition, then we'll concatenate the definitions using commas
|
||||
// like normal and generate the SQL.
|
||||
$columns = implode(', ', array_map(function($column)
|
||||
{
|
||||
return 'ADD COLUMN '.$column;
|
||||
@@ -114,10 +114,9 @@ class Postgres extends Grammar {
|
||||
*/
|
||||
protected function incrementer(Table $table, Fluent $column)
|
||||
{
|
||||
// We don't actually need to specify an "auto_increment" keyword since
|
||||
// we handle the auto-increment definition in the type definition for
|
||||
// integers by changing the type to "serial", which is a convenient
|
||||
// notational short-cut provided by Postgres.
|
||||
// We don't actually need to specify an "auto_increment" keyword since we
|
||||
// handle the auto-increment definition in the type definition for
|
||||
// integers by changing the type to "serial".
|
||||
if ($column->type == 'integer' and $column->increment)
|
||||
{
|
||||
return ' PRIMARY KEY';
|
||||
@@ -218,9 +217,9 @@ class Postgres extends Grammar {
|
||||
{
|
||||
$columns = array_map(array($this, 'wrap'), $command->columns);
|
||||
|
||||
// Once we the array of column names, we need to add "drop" to the
|
||||
// front of each column, then we'll concatenate the columns using
|
||||
// commas and generate the alter statement SQL.
|
||||
// Once we the array of column names, we need to add "drop" to the front
|
||||
// of each column, then we'll concatenate the columns using commas and
|
||||
// generate the alter statement SQL.
|
||||
$columns = implode(', ', array_map(function($column)
|
||||
{
|
||||
return 'DROP COLUMN '.$column;
|
||||
|
||||
Reference in New Issue
Block a user