mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-09-29 20:59:01 +02:00
BUGFIX: remove mysql codegen of multi-enums from postgres, and emit an error, and return a valid data type so that sapphire unit tests fail but don't crash
This commit is contained in:
parent
77b972bfb5
commit
e5dfd2b080
@ -1662,14 +1662,15 @@ class PostgreSQLDatabase extends SS_Database {
|
|||||||
/**
|
/**
|
||||||
* Return a set type-formatted string
|
* Return a set type-formatted string
|
||||||
* This is used for Multi-enum support, which isn't actually supported by Postgres.
|
* This is used for Multi-enum support, which isn't actually supported by Postgres.
|
||||||
|
* Throws a user error to show our lack of support, and return an "int", specifically for sapphire
|
||||||
|
* tests that test multi-enums. This results in a test failure, but not crashing the test run.
|
||||||
*
|
*
|
||||||
* @param array $values Contains a tokenised list of info about this data type
|
* @param array $values Contains a tokenised list of info about this data type
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function set($values){
|
public function set($values){
|
||||||
//For reference, this is what typically gets passed to this function:
|
user_error("PostGreSQL does not support multi-enum");
|
||||||
$default = empty($values['default']) ? '' : " default '$values[default]'";
|
return "int";
|
||||||
return 'set(\'' . implode('\',\'', $values['enums']) . '\') character set utf8 collate utf8_general_ci' . $default;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user