BUG FIX: constraints fixed for very long constraint data

This commit is contained in:
Geoff Munn 2009-05-06 00:02:43 +00:00
parent 72e8d924e7
commit 703fde9fb5

View File

@ -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;
}