Skip to content

Commit abb1aa8

Browse files
committed
added jsonb column type support
1 parent 7f6cfae commit abb1aa8

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/Bosnadev/Database/Schema/Blueprint.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,14 @@ public function hstore($column) {
3434
public function uuid($column) {
3535
return $this->addColumn('uuid', $column);
3636
}
37+
38+
/**
39+
* Create a new jsonb column on the table
40+
*
41+
* @param $column
42+
* @return \Illuminate\Support\Fluent
43+
*/
44+
public function jsonb($column) {
45+
return $this->addColumn('jsonb', $column);
46+
}
3747
}

src/Bosnadev/Database/Schema/Grammars/PostgresGrammar.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ protected function typeCharacter(Fluent $column)
2121
}
2222

2323
/**
24+
* Create the column definition for a hstore type.
25+
*
2426
* @param Fluent $column
2527
* @return string
2628
*/
@@ -29,13 +31,25 @@ protected function typeHstore(Fluent $column) {
2931
}
3032

3133
/**
34+
* Create the column definition for a uuid type.
35+
*
3236
* @param Fluent $column
3337
* @return string
3438
*/
3539
protected function typeUuid(Fluent $column) {
3640
return "uuid";
3741
}
3842

43+
/**
44+
* Create the column definition for a jsonb type.
45+
*
46+
* @param Fluent $column
47+
* @return string
48+
*/
49+
protected function typeJsonb(Fluent $column) {
50+
return "jsonb";
51+
}
52+
3953
/**
4054
* @param mixed $value
4155
* @return mixed|string

0 commit comments

Comments
 (0)