cvs: pear /MDB2/MDB2/Driver/Reverse mssql.php
| From: | Lorenzo Alberton | Date: | Sun, 04 Mar 2007 18:05:59 +0000 |
| Subject: | cvs: pear /MDB2/MDB2/Driver/Reverse mssql.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-44945@lists.php.net to get a copy of this message | ||
quipo Sun Mar 4 18:05:59 2007 UTC
Modified files:
/pear/MDB2/MDB2/Driver/Reverse mssql.php
Log:
don't list constraints in getTableIndexDefinition()
http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Reverse/mssql.php?r1=1.34&r2=1.35&diff_format=u
Index: pear/MDB2/MDB2/Driver/Reverse/mssql.php
diff -u pear/MDB2/MDB2/Driver/Reverse/mssql.php:1.34 pear/MDB2/MDB2/Driver/Reverse/mssql.php:1.35
--- pear/MDB2/MDB2/Driver/Reverse/mssql.php:1.34 Sun Mar 4 17:19:04 2007
+++ pear/MDB2/MDB2/Driver/Reverse/mssql.php Sun Mar 4 18:05:58 2007
@@ -43,7 +43,7 @@
// | Lorenzo Alberton <l.alberton@quipo.it> |
// +----------------------------------------------------------------------+
//
-// $Id: mssql.php,v 1.34 2007/03/04 17:19:04 quipo Exp $
+// $Id: mssql.php,v 1.35 2007/03/04 18:05:58 quipo Exp $
//
require_once 'MDB2/Driver/Reverse/Common.php';
@@ -201,16 +201,18 @@
c.name field_name,
CASE INDEXKEY_PROPERTY(i.id, i.indid, ik.keyno, 'IsDescending')
WHEN 1 THEN 'DESC' ELSE 'ASC'
- END 'collation',
- CASE o.xtype
- WHEN 'UQ' THEN 1 ELSE 0
- END 'unique'
+ END 'collation'
FROM sysindexes i
JOIN sysobjects o ON o.id = i.id
JOIN sysindexkeys ik ON ik.id = i.id AND ik.indid = i.indid
JOIN syscolumns c ON c.id = ik.id AND c.colid = ik.colid
WHERE OBJECT_NAME(i.id) = '$table'
AND i.name = '%s'
+ AND NOT EXISTS (
+ SELECT *
+ FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE k
+ WHERE k.table_name = OBJECT_NAME(i.id)
+ AND k.constraint_name = i.name)
ORDER BY tablename, indexname, ik.keyno";
$index_name_mdb2 = $db->getIndexName($index_name);
@@ -240,7 +242,6 @@
$definition['fields'][$column_name]['sorting'] =
($row['collation'] == 'ASC'
? 'ascending' : 'descending');
}
- $definition['unique'] = $row['unique'];
}
$result->free();
if (empty($definition['fields'])) {