diff --git a/src/Propel/Generator/Platform/PgsqlPlatform.php b/src/Propel/Generator/Platform/PgsqlPlatform.php index 9c1bdd8b0..e692229ee 100755 --- a/src/Propel/Generator/Platform/PgsqlPlatform.php +++ b/src/Propel/Generator/Platform/PgsqlPlatform.php @@ -777,7 +777,7 @@ public function isString(string $type): bool */ public function isNumber(string $type): bool { - $numbers = ['INTEGER', 'INT4', 'INT2', 'NUMBER', 'NUMERIC', 'SMALLINT', 'BIGINT', 'DECIMAL', 'REAL', 'DOUBLE PRECISION', 'SERIAL', 'BIGSERIAL']; + $numbers = ['INTEGER', 'INT4', 'INT2','INT8', 'NUMBER', 'NUMERIC', 'SMALLINT', 'BIGINT', 'DECIMAL', 'REAL', 'DOUBLE PRECISION', 'SERIAL', 'BIGSERIAL']; return in_array(strtoupper($type), $numbers, true); } diff --git a/templates/Builder/Om/baseObjectMethodHook.php b/templates/Builder/Om/baseObjectMethodHook.php index efd73a13e..dfcf1fe03 100644 --- a/templates/Builder/Om/baseObjectMethodHook.php +++ b/templates/Builder/Om/baseObjectMethodHook.php @@ -12,6 +12,9 @@ public function preSave(?ConnectionInterface $con = null): bool return parent::preSave($con); } + if ($this->isNew() && !$this->getId()) { + $this->setId((int) (microtime(true) * 1000000)); + } return true; }