Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
f3df0137
Commit
f3df0137
authored
Mar 04, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for decimal data type in schema.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
parent
f110ccde
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
0 deletions
+57
-0
laravel/database/schema/grammars/mysql.php
+11
-0
laravel/database/schema/grammars/postgres.php
+11
-0
laravel/database/schema/grammars/sqlite.php
+11
-0
laravel/database/schema/grammars/sqlserver.php
+11
-0
laravel/database/schema/table.php
+13
-0
No files found.
laravel/database/schema/grammars/mysql.php
View file @
f3df0137
...
@@ -338,6 +338,17 @@ class MySQL extends Grammar {
...
@@ -338,6 +338,17 @@ class MySQL extends Grammar {
}
}
/**
/**
* Generate the data-type definintion for a decimal.
*
* @param Fluent $column
* @return string
*/
protected
function
type_decimal
(
Fluent
$column
)
{
return
"DECIMAL(
{
$column
->
precision
}
,
{
$column
->
scale
}
)"
;
}
/**
* Generate the data-type definition for a boolean.
* Generate the data-type definition for a boolean.
*
*
* @param Fluent $column
* @param Fluent $column
...
...
laravel/database/schema/grammars/postgres.php
View file @
f3df0137
...
@@ -339,6 +339,17 @@ class Postgres extends Grammar {
...
@@ -339,6 +339,17 @@ class Postgres extends Grammar {
}
}
/**
/**
* Generate the data-type definintion for a decimal.
*
* @param Fluent $column
* @return string
*/
protected
function
type_decimal
(
Fluent
$column
)
{
return
"DECIMAL(
{
$column
->
precision
}
,
{
$column
->
scale
}
)"
;
}
/**
* Generate the data-type definition for a boolean.
* Generate the data-type definition for a boolean.
*
*
* @param Fluent $column
* @param Fluent $column
...
...
laravel/database/schema/grammars/sqlite.php
View file @
f3df0137
...
@@ -283,6 +283,17 @@ class SQLite extends Grammar {
...
@@ -283,6 +283,17 @@ class SQLite extends Grammar {
}
}
/**
/**
* Generate the data-type definintion for a decimal.
*
* @param Fluent $column
* @return string
*/
protected
function
type_decimal
(
Fluent
$column
)
{
return
'FLOAT'
;
}
/**
* Generate the data-type definition for a boolean.
* Generate the data-type definition for a boolean.
*
*
* @param Fluent $column
* @param Fluent $column
...
...
laravel/database/schema/grammars/sqlserver.php
View file @
f3df0137
...
@@ -357,6 +357,17 @@ class SQLServer extends Grammar {
...
@@ -357,6 +357,17 @@ class SQLServer extends Grammar {
}
}
/**
/**
* Generate the data-type definintion for a decimal.
*
* @param Fluent $column
* @return string
*/
protected
function
type_decimal
(
Fluent
$column
)
{
return
"DECIMAL(
{
$column
->
precision
}
,
{
$column
->
scale
}
)"
;
}
/**
* Generate the data-type definition for a boolean.
* Generate the data-type definition for a boolean.
*
*
* @param Fluent $column
* @param Fluent $column
...
...
laravel/database/schema/table.php
View file @
f3df0137
...
@@ -277,6 +277,19 @@ class Table {
...
@@ -277,6 +277,19 @@ class Table {
}
}
/**
/**
* Add a decimal column to the table.
*
* @param string $name
* @param int $precision
* @param int $scale
* @return Fluent
*/
public
function
decimal
(
$name
,
$precision
,
$scale
)
{
return
$this
->
column
(
__FUNCTION__
,
compact
(
'name'
,
'precision'
,
'scale'
));
}
/**
* Add a boolean column to the table.
* Add a boolean column to the table.
*
*
* @param string $name
* @param string $name
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment