mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-10-22 17:05:45 +02:00
Enable support for jsonb field types
Adds a function to PostgreSQLSchemaManager.php to allow for FieldTypes that specify "json" as their type. Doing so will create a jsonb column in the database, which is better for jsonpath value retrieval than it's regular json counterpart.
This commit is contained in:
parent
a7c3450d43
commit
6b7eb1cc6b
@ -1247,6 +1247,17 @@ class PostgreSQLSchemaManager extends DBSchemaManager
|
||||
return "decimal(4,0)";
|
||||
}
|
||||
|
||||
/*
|
||||
* Return a JSON Binary field type (better for searching than a plain JSON type)
|
||||
*
|
||||
* @param array $values Contains a tokenised list of info about this data type
|
||||
* @return string
|
||||
*/
|
||||
public function json($values)
|
||||
{
|
||||
return "jsonb";
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a fulltext search datatype for PostgreSQL
|
||||
* This will also return a trigger to be applied to this table
|
||||
|
Loading…
Reference in New Issue
Block a user