UpdateDatabase.php
authorAlan Knowles <alan@roojs.com>
Fri, 15 Nov 2013 04:55:49 +0000 (12:55 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 15 Nov 2013 04:55:49 +0000 (12:55 +0800)
UpdateDatabase.php

index 8b89a14..f4f1afa 100644 (file)
@@ -183,11 +183,13 @@ class Pman_Xtuple_UpdateDatabase extends Pman
         DB_DataObject::debugLevel(1);
         $cs = DB_DataObject::factory('core_enum');
          $cs->query("
-               SELECT  'SELECT SETVAL(' ||quote_literal(quote_ident(S.relname))|| ', MAX(' ||quote_ident(C.attname)|| ') )  FROM ' ||quote_ident(T.relname)|| ';' as cmd 
+               SELECT  'SELECT SETVAL(' ||
+                        nspname || '.' || quote_literal(quote_ident(S.relname))||
+                        ', MAX(' || nspname || '.' || quote_ident(C.attname)|| ') )  FROM ' || nspname || '.' || quote_ident(T.relname)|| ';' as cmd 
                 FROM pg_class AS S,
                     pg_depend AS D,
                     pg_class AS T,
-                    pg_attribute AS C
+                    pg_attribute AS C,
                     pg_namespace AS NS
                 WHERE S.relkind = 'S'
                     AND S.oid = D.objid