diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-02-07 05:23:32 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-02-07 05:23:32 +0000 |
commit | 66c63ff3e2be461b9edf1775c7ffffca74c8efde (patch) | |
tree | 7ff2d30154ef9177485f4502004637ace9b0a6b3 /includes/database/pgsql/schema.inc | |
parent | 84d9994485ae1b0ea84c986ea69475c77a385b2b (diff) | |
download | brdo-66c63ff3e2be461b9edf1775c7ffffca74c8efde.tar.gz brdo-66c63ff3e2be461b9edf1775c7ffffca74c8efde.tar.bz2 |
#522786 by stormsweeper: Fixed Postgres numeric check needs to happen after precision check in schema generation.
Diffstat (limited to 'includes/database/pgsql/schema.inc')
-rw-r--r-- | includes/database/pgsql/schema.inc | 7 |
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'; } |