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
ebcae547
Commit
ebcae547
authored
Feb 29, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #370 from cviebrock/develop
Add unsigned() modifier, so you can create unsigned integer columns.
parents
30d69ef5
b7d068f2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
4 deletions
+19
-4
grammar.php
laravel/database/schema/grammars/grammar.php
+15
-0
mysql.php
laravel/database/schema/grammars/mysql.php
+1
-1
postgres.php
laravel/database/schema/grammars/postgres.php
+1
-1
sqlite.php
laravel/database/schema/grammars/sqlite.php
+1
-1
sqlserver.php
laravel/database/schema/grammars/sqlserver.php
+1
-1
No files found.
laravel/database/schema/grammars/grammar.php
View file @
ebcae547
...
@@ -39,4 +39,19 @@ abstract class Grammar extends \Laravel\Database\Grammar {
...
@@ -39,4 +39,19 @@ abstract class Grammar extends \Laravel\Database\Grammar {
return
parent
::
wrap
(
$value
);
return
parent
::
wrap
(
$value
);
}
}
/**
* Get the SQL syntax for indicating if a column is unsigned.
*
* @param Table $table
* @param Fluent $column
* @return string
*/
protected
function
unsigned
(
Table
$table
,
Fluent
$column
)
{
if
(
$column
->
type
==
'integer'
&&
$column
->
unsigned
)
{
return
' UNSIGNED'
;
}
}
}
}
\ No newline at end of file
laravel/database/schema/grammars/mysql.php
View file @
ebcae547
...
@@ -77,7 +77,7 @@ class MySQL extends Grammar {
...
@@ -77,7 +77,7 @@ class MySQL extends Grammar {
// types to the correct types.
// types to the correct types.
$sql
=
$this
->
wrap
(
$column
)
.
' '
.
$this
->
type
(
$column
);
$sql
=
$this
->
wrap
(
$column
)
.
' '
.
$this
->
type
(
$column
);
$elements
=
array
(
'nullable'
,
'defaults'
,
'incrementer'
);
$elements
=
array
(
'
unsigned'
,
'
nullable'
,
'defaults'
,
'incrementer'
);
foreach
(
$elements
as
$element
)
foreach
(
$elements
as
$element
)
{
{
...
...
laravel/database/schema/grammars/postgres.php
View file @
ebcae547
...
@@ -65,7 +65,7 @@ class Postgres extends Grammar {
...
@@ -65,7 +65,7 @@ class Postgres extends Grammar {
// types to the types used by the database.
// types to the types used by the database.
$sql
=
$this
->
wrap
(
$column
)
.
' '
.
$this
->
type
(
$column
);
$sql
=
$this
->
wrap
(
$column
)
.
' '
.
$this
->
type
(
$column
);
$elements
=
array
(
'incrementer'
,
'nullable'
,
'defaults'
);
$elements
=
array
(
'
unsigned'
,
'
incrementer'
,
'nullable'
,
'defaults'
);
foreach
(
$elements
as
$element
)
foreach
(
$elements
as
$element
)
{
{
...
...
laravel/database/schema/grammars/sqlite.php
View file @
ebcae547
...
@@ -91,7 +91,7 @@ class SQLite extends Grammar {
...
@@ -91,7 +91,7 @@ class SQLite extends Grammar {
// types to the types used by the database.
// types to the types used by the database.
$sql
=
$this
->
wrap
(
$column
)
.
' '
.
$this
->
type
(
$column
);
$sql
=
$this
->
wrap
(
$column
)
.
' '
.
$this
->
type
(
$column
);
$elements
=
array
(
'nullable'
,
'defaults'
,
'incrementer'
);
$elements
=
array
(
'
unsigned'
,
'
nullable'
,
'defaults'
,
'incrementer'
);
foreach
(
$elements
as
$element
)
foreach
(
$elements
as
$element
)
{
{
...
...
laravel/database/schema/grammars/sqlserver.php
View file @
ebcae547
...
@@ -72,7 +72,7 @@ class SQLServer extends Grammar {
...
@@ -72,7 +72,7 @@ class SQLServer extends Grammar {
// types to the types used by the database.
// types to the types used by the database.
$sql
=
$this
->
wrap
(
$column
)
.
' '
.
$this
->
type
(
$column
);
$sql
=
$this
->
wrap
(
$column
)
.
' '
.
$this
->
type
(
$column
);
$elements
=
array
(
'incrementer'
,
'nullable'
,
'defaults'
);
$elements
=
array
(
'
unsigned'
,
'
incrementer'
,
'nullable'
,
'defaults'
);
foreach
(
$elements
as
$element
)
foreach
(
$elements
as
$element
)
{
{
...
...
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