Skip to content

Commit

Permalink
binaryuuid support for also SQLite and Postgres.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Apr 10, 2020
1 parent 08d1e7f commit b170f74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Phinx/Db/Adapter/PostgresAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down Expand Up @@ -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']);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/Phinx/Db/Adapter/SQLiteAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,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',
];
Expand Down

0 comments on commit b170f74

Please sign in to comment.