Skip to content

Commit

Permalink
Improve temporal columns docblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
paulofreitas committed Nov 8, 2017
1 parent 5cbe957 commit 1a815e8
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 24 deletions.
14 changes: 7 additions & 7 deletions src/Illuminate/Database/Schema/Blueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ public function dateTime($column, $precision = 0)
}

/**
* Create a new date-time column (with time zone) on the table.
* Create a new date-time (with time zone) column on the table.
*
* @param string $column
* @param int $precision
Expand All @@ -808,7 +808,7 @@ public function time($column, $precision = 0)
}

/**
* Create a new time column (with time zone) on the table.
* Create a new time (with time zone) column on the table.
*
* @param string $column
* @param int $precision
Expand Down Expand Up @@ -844,7 +844,7 @@ public function timestampTz($column, $precision = 0)
}

/**
* Add nullable creation and update timestamps to the table.
* Add nullable creation and update timestamps columns to the table.
*
* @param int $precision
* @return void
Expand All @@ -857,7 +857,7 @@ public function timestamps($precision = 0)
}

/**
* Add nullable creation and update timestamps to the table.
* Add nullable creation and update timestamps columns to the table.
*
* Alias for self::timestamps().
*
Expand All @@ -870,7 +870,7 @@ public function nullableTimestamps($precision = 0)
}

/**
* Add creation and update timestampTz columns to the table.
* Add nullable creation and update timestamps (with time zone) columns to the table.
*
* @param int $precision
* @return void
Expand All @@ -883,7 +883,7 @@ public function timestampsTz($precision = 0)
}

/**
* Add a "deleted at" timestamp for the table.
* Add a nullable deletion timestamp column to the table.
*
* @param string $column
* @param int $precision
Expand All @@ -895,7 +895,7 @@ public function softDeletes($column = 'deleted_at', $precision = 0)
}

/**
* Add a "deleted at" timestampTz for the table.
* Add a nullable deletion timestamp (with time zone) column to the table.
*
* @param int $precision
* @return \Illuminate\Support\Fluent
Expand Down
8 changes: 5 additions & 3 deletions src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ protected function typeDateTime(Fluent $column)
}

/**
* Create the column definition for a date-time type.
* Create the column definition for a date-time (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand All @@ -626,7 +626,7 @@ protected function typeTime(Fluent $column)
}

/**
* Create the column definition for a time type.
* Create the column definition for a time (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand All @@ -650,7 +650,7 @@ protected function typeTimestamp(Fluent $column)
}

/**
* Create the column definition for a timestamp type.
* Create the column definition for a timestamp (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand Down Expand Up @@ -795,6 +795,8 @@ public function typeMultiPolygon(Fluent $column)
/**
* Parse the default value for a temporal column type.
*
* @see https://dev.mysql.com/doc/refman/5.7/en/timestamp-initialization.html
*
* @param \Illuminate\Support\Fluent $column
* @return void
*/
Expand Down
8 changes: 5 additions & 3 deletions src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ protected function typeDateTime(Fluent $column)
}

/**
* Create the column definition for a date-time type.
* Create the column definition for a date-time (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand All @@ -575,7 +575,7 @@ protected function typeTime(Fluent $column)
}

/**
* Create the column definition for a time type.
* Create the column definition for a time (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand All @@ -601,7 +601,7 @@ protected function typeTimestamp(Fluent $column)
}

/**
* Create the column definition for a timestamp type.
* Create the column definition for a timestamp (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand Down Expand Up @@ -759,6 +759,8 @@ private function formatPostGisType(string $type)
/**
* Parse the default value for a temporal column type.
*
* @see https://www.postgresql.org/docs/10/static/functions-datetime.html#functions-datetime-current
*
* @param \Illuminate\Support\Fluent $column
* @return void
*/
Expand Down
23 changes: 17 additions & 6 deletions src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,10 @@ protected function typeDate(Fluent $column)
/**
* Create the column definition for a date-time type.
*
* Note: SQLite does not have a storage class set aside for storing dates and/or times.
*
* @see https://www.sqlite.org/datatype3.html
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
Expand All @@ -562,10 +566,7 @@ protected function typeDateTime(Fluent $column)
}

/**
* Create the column definition for a date-time type.
*
* Note: "SQLite does not have a storage class set aside for storing dates and/or times."
* @link https://www.sqlite.org/datatype3.html
* Create the column definition for a date-time (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand All @@ -578,6 +579,10 @@ protected function typeDateTimeTz(Fluent $column)
/**
* Create the column definition for a time type.
*
* Note: SQLite does not have a storage class set aside for storing dates and/or times.
*
* @see https://www.sqlite.org/datatype3.html
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
Expand All @@ -589,7 +594,7 @@ protected function typeTime(Fluent $column)
}

/**
* Create the column definition for a time type.
* Create the column definition for a time (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand All @@ -602,6 +607,10 @@ protected function typeTimeTz(Fluent $column)
/**
* Create the column definition for a timestamp type.
*
* Note: SQLite does not have a storage class set aside for storing dates and/or times.
*
* @see https://www.sqlite.org/datatype3.html
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
Expand All @@ -611,7 +620,7 @@ protected function typeTimestamp(Fluent $column)
}

/**
* Create the column definition for a timestamp type.
* Create the column definition for a timestamp (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand Down Expand Up @@ -756,6 +765,8 @@ public function typeMultiPolygon(Fluent $column)
/**
* Parse the default value for a temporal column type.
*
* @see https://www.sqlite.org/lang_createtable.html#tablecoldef
*
* @param \Illuminate\Support\Fluent $column
* @return void
*/
Expand Down
12 changes: 7 additions & 5 deletions src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,8 @@ protected function typeDate(Fluent $column)
/**
* Create the column definition for a date-time type.
*
* Note: DATETIME is being used in place of DATETIME2(0) for SQL Server 2005 compatibility
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
Expand All @@ -505,7 +507,7 @@ protected function typeDateTime(Fluent $column)
}

/**
* Create the column definition for a date-time type.
* Create the column definition for a date-time (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand All @@ -531,7 +533,7 @@ protected function typeTime(Fluent $column)
}

/**
* Create the column definition for a time type.
* Create the column definition for a time (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand All @@ -553,9 +555,7 @@ protected function typeTimestamp(Fluent $column)
}

/**
* Create the column definition for a timestamp type.
*
* @link https://msdn.microsoft.com/en-us/library/bb630289(v=sql.120).aspx
* Create the column definition for a timestamp (with time zone) type.
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand Down Expand Up @@ -700,6 +700,8 @@ public function typeMultiPolygon(Fluent $column)
/**
* Parse the default value for a temporal column type.
*
* @see https://docs.microsoft.com/en-us/sql/t-sql/statements/create-table-transact-sql#default-definitions
*
* @param \Illuminate\Support\Fluent $column
* @return void
*/
Expand Down

0 comments on commit 1a815e8

Please sign in to comment.