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 13, 2017
1 parent 09942f1 commit 6ee8d8f
Show file tree
Hide file tree
Showing 5 changed files with 60 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
14 changes: 11 additions & 3 deletions src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,8 @@ protected function typeJsonb(Fluent $column)
/**
* Create the column definition for a date type.
*
* @see https://dev.mysql.com/doc/refman/5.7/en/datetime.html
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
Expand All @@ -588,6 +590,8 @@ protected function typeDate(Fluent $column)
/**
* Create the column definition for a date-time type.
*
* @see https://dev.mysql.com/doc/refman/5.7/en/datetime.html
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
Expand All @@ -599,7 +603,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 @@ -612,6 +616,8 @@ protected function typeDateTimeTz(Fluent $column)
/**
* Create the column definition for a time type.
*
* @see https://dev.mysql.com/doc/refman/5.7/en/time.html
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
Expand All @@ -621,7 +627,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 @@ -634,6 +640,8 @@ protected function typeTimeTz(Fluent $column)
/**
* Create the column definition for a timestamp type.
*
* @see https://dev.mysql.com/doc/refman/5.7/en/datetime.html
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
Expand All @@ -645,7 +653,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
16 changes: 13 additions & 3 deletions src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,8 @@ protected function typeJsonb(Fluent $column)
/**
* Create the column definition for a date type.
*
* @see https://www.postgresql.org/docs/current/static/datatype-datetime.html
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
Expand All @@ -550,7 +552,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 @@ -563,6 +565,8 @@ protected function typeDateTimeTz(Fluent $column)
/**
* Create the column definition for a time type.
*
* @see https://www.postgresql.org/docs/current/static/datatype-datetime.html
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
Expand All @@ -574,7 +578,9 @@ protected function typeTime(Fluent $column)
}

/**
* Create the column definition for a time type.
* Create the column definition for a time (with time zone) type.
*
* @see https://www.postgresql.org/docs/current/static/datatype-datetime.html
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand All @@ -589,6 +595,8 @@ protected function typeTimeTz(Fluent $column)
/**
* Create the column definition for a timestamp type.
*
* @see https://www.postgresql.org/docs/current/static/datatype-datetime.html
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
Expand All @@ -600,7 +608,9 @@ protected function typeTimestamp(Fluent $column)
}

/**
* Create the column definition for a timestamp type.
* Create the column definition for a timestamp (with time zone) type.
*
* @see https://www.postgresql.org/docs/current/static/datatype-datetime.html
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand Down
21 changes: 15 additions & 6 deletions src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,10 @@ protected function typeJsonb(Fluent $column)
/**
* Create the column definition for a date type.
*
* Note: SQLite does not have a storage class set aside for storing dates and/or times.
*
* @see https://sqlite.org/datatype3.html#date_and_time_datatype
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
Expand All @@ -550,6 +554,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://sqlite.org/datatype3.html#date_and_time_datatype
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
Expand All @@ -561,10 +569,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 @@ -577,6 +582,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://sqlite.org/datatype3.html#date_and_time_datatype
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
Expand All @@ -588,7 +597,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 @@ -610,7 +619,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
19 changes: 14 additions & 5 deletions src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ protected function typeJsonb(Fluent $column)
/**
* Create the column definition for a date type.
*
* @see https://docs.microsoft.com/en-us/sql/t-sql/data-types/date-transact-sql
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
Expand All @@ -493,6 +495,11 @@ 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
*
* @see https://docs.microsoft.com/en-us/sql/t-sql/data-types/datetime2-transact-sql
* @see https://docs.microsoft.com/en-us/sql/t-sql/data-types/datetime-transact-sql
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
Expand All @@ -504,7 +511,9 @@ 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.
*
* @see https://docs.microsoft.com/en-us/sql/t-sql/data-types/datetimeoffset-transact-sql
*
* @param \Illuminate\Support\Fluent $column
* @return string
Expand All @@ -519,6 +528,8 @@ protected function typeDateTimeTz(Fluent $column)
/**
* Create the column definition for a time type.
*
* @see https://docs.microsoft.com/en-us/sql/t-sql/data-types/time-transact-sql
*
* @param \Illuminate\Support\Fluent $column
* @return string
*/
Expand All @@ -530,7 +541,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 @@ -552,9 +563,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

0 comments on commit 6ee8d8f

Please sign in to comment.