mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 08:05:53 +02:00
BUG FIX: constraints fixed for very long constraint data
This commit is contained in:
parent
72e8d924e7
commit
703fde9fb5
@ -315,7 +315,7 @@ class MSSQLDatabase extends Database {
|
||||
* This is a private MSSQL-only function which returns specific details about a column's constraints (if any)
|
||||
*/
|
||||
private function ColumnConstraints($tableName, $columnName){
|
||||
$constraint=$this->query("SELECT CC.CONSTRAINT_NAME, CHECK_CLAUSE, COLUMN_NAME FROM INFORMATION_SCHEMA.CHECK_CONSTRAINTS AS CC INNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE AS CCU ON CCU.CONSTRAINT_NAME=CC.CONSTRAINT_NAME WHERE TABLE_NAME='$tableName' AND COLUMN_NAME='" . $columnName . "';")->first();
|
||||
$constraint=$this->query("SELECT CC.CONSTRAINT_NAME, CAST(CHECK_CLAUSE AS TEXT) AS CHECK_CLAUSE, COLUMN_NAME FROM INFORMATION_SCHEMA.CHECK_CONSTRAINTS AS CC INNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE AS CCU ON CCU.CONSTRAINT_NAME=CC.CONSTRAINT_NAME WHERE TABLE_NAME='$tableName' AND COLUMN_NAME='" . $columnName . "';")->first();
|
||||
|
||||
return $constraint;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user