summaryrefslogtreecommitdiff
path: root/includes/database/pgsql
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-01-30 02:56:32 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-01-30 02:56:32 +0000
commit12ed4706557d978b0f43c3b8ab8cf454ebb590ac (patch)
treed14b3cf085e823f02448061d0db1f92d7d28a6b2 /includes/database/pgsql
parent43cdf31483023bda61935186ba20184b01543125 (diff)
downloadbrdo-12ed4706557d978b0f43c3b8ab8cf454ebb590ac.tar.gz
brdo-12ed4706557d978b0f43c3b8ab8cf454ebb590ac.tar.bz2
#522786 by stormsweeper: Fixed PostgreSQL numeric check needs to happen after precision check in schema generation.
Diffstat (limited to 'includes/database/pgsql')
-rw-r--r--includes/database/pgsql/schema.inc7
1 files changed, 4 insertions, 3 deletions
diff --git a/includes/database/pgsql/schema.inc b/includes/database/pgsql/schema.inc
index 578c074bb..d2e837d1e 100644
--- a/includes/database/pgsql/schema.inc
+++ b/includes/database/pgsql/schema.inc
@@ -147,9 +147,6 @@ class DatabaseSchema_pgsql extends DatabaseSchema {
if ($spec['type'] == 'serial') {
unset($spec['not null']);
}
- if (!empty($spec['unsigned'])) {
- $sql .= " CHECK ($name >= 0)";
- }
if (in_array($spec['type'], array('varchar', 'char', 'text')) && isset($spec['length'])) {
$sql .= '(' . $spec['length'] . ')';
@@ -158,6 +155,10 @@ class DatabaseSchema_pgsql extends DatabaseSchema {
$sql .= '(' . $spec['precision'] . ', ' . $spec['scale'] . ')';
}
+ if (!empty($spec['unsigned'])) {
+ $sql .= " CHECK ($name >= 0)";
+ }
+
if (isset($spec['not null']) && $spec['not null']) {
$sql .= ' NOT NULL';
}