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 11, 2020
1 parent 3a85325 commit bb3d76f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Phinx/Db/Adapter/PostgresAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class PostgresAdapter extends PdoAdapter
self::PHINX_TYPE_INET,
self::PHINX_TYPE_MACADDR,
self::PHINX_TYPE_INTERVAL,
self::PHINX_TYPE_BINARYUUID,
];

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

Please sign in to comment.