From d7188bf58452a0b5c52086b5007bb7f202a30ab7 Mon Sep 17 00:00:00 2001 From: mscherer Date: Fri, 10 Apr 2020 16:12:25 +0200 Subject: [PATCH] binaryuuid support for also SQLite and Postgres. --- src/Phinx/Db/Adapter/PostgresAdapter.php | 4 +++- src/Phinx/Db/Adapter/SQLiteAdapter.php | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Phinx/Db/Adapter/PostgresAdapter.php b/src/Phinx/Db/Adapter/PostgresAdapter.php index 169d3adc55..31e229815d 100644 --- a/src/Phinx/Db/Adapter/PostgresAdapter.php +++ b/src/Phinx/Db/Adapter/PostgresAdapter.php @@ -971,6 +971,8 @@ public function getSqlType($type, $limit = null) return ['name' => 'real']; case static::PHINX_TYPE_DATETIME: return ['name' => 'timestamp']; + case static::PHINX_TYPE_BINARYUUID: + return ['name' => 'uuid']; case static::PHINX_TYPE_BLOB: case static::PHINX_TYPE_BINARY: return ['name' => 'bytea']; @@ -1359,7 +1361,7 @@ public function getAllSchemas() */ public function getColumnTypes() { - return array_merge(parent::getColumnTypes(), ['json', 'jsonb', 'cidr', 'inet', 'macaddr', 'interval']); + return array_merge(parent::getColumnTypes(), ['json', 'jsonb', 'cidr', 'inet', 'macaddr', 'interval', 'binaryuuid']); } /** diff --git a/src/Phinx/Db/Adapter/SQLiteAdapter.php b/src/Phinx/Db/Adapter/SQLiteAdapter.php index c194b62c93..5eaefe239d 100644 --- a/src/Phinx/Db/Adapter/SQLiteAdapter.php +++ b/src/Phinx/Db/Adapter/SQLiteAdapter.php @@ -50,6 +50,7 @@ class SQLiteAdapter extends PdoAdapter self::PHINX_TYPE_TEXT => 'text', self::PHINX_TYPE_TIME => 'time_text', self::PHINX_TYPE_UUID => 'uuid_text', + self::PHINX_TYPE_BINARYUUID => 'binary_blob', self::PHINX_TYPE_TIMESTAMP => 'timestamp_text', self::PHINX_TYPE_VARBINARY => 'varbinary_blob', ];