Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
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
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
0 deletions
+57
-0
mysql.php
laravel/database/schema/grammars/mysql.php
+11
-0
postgres.php
laravel/database/schema/grammars/postgres.php
+11
-0
sqlite.php
laravel/database/schema/grammars/sqlite.php
+11
-0
sqlserver.php
laravel/database/schema/grammars/sqlserver.php
+11
-0
table.php
laravel/database/schema/table.php
+13
-0
No files found.
laravel/database/schema/grammars/mysql.php
View file @
f3df0137
...
...
@@ -337,6 +337,17 @@ class MySQL extends Grammar {
return
'FLOAT'
;
}
/**
* 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.
*
...
...
laravel/database/schema/grammars/postgres.php
View file @
f3df0137
...
...
@@ -338,6 +338,17 @@ class Postgres extends Grammar {
return
'REAL'
;
}
/**
* 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.
*
...
...
laravel/database/schema/grammars/sqlite.php
View file @
f3df0137
...
...
@@ -282,6 +282,17 @@ class SQLite extends Grammar {
return
'FLOAT'
;
}
/**
* 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.
*
...
...
laravel/database/schema/grammars/sqlserver.php
View file @
f3df0137
...
...
@@ -356,6 +356,17 @@ class SQLServer extends Grammar {
return
'FLOAT'
;
}
/**
* 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.
*
...
...
laravel/database/schema/table.php
View file @
f3df0137
...
...
@@ -276,6 +276,19 @@ class Table {
return
$this
->
column
(
__FUNCTION__
,
compact
(
'name'
));
}
/**
* 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.
*
...
...
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