PHPackages                             paramah/id-to-uuid - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. paramah/id-to-uuid

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

paramah/id-to-uuid
==================

Easily migrate from auto incremented id to uuid

v2.0(7y ago)1300MITPHP

Since Jun 21Pushed 4y agoCompare

[ Source](https://github.com/paramah/id-to-uuid)[ Packagist](https://packagist.org/packages/paramah/id-to-uuid)[ RSS](/packages/paramah-id-to-uuid/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (6)Used By (0)

id-to-uuid
==========

[](#id-to-uuid)

Easily migrate from an auto incremented integer id to a [uuid](https://en.wikipedia.org/wiki/Universally_unique_identifier) in a project using [DoctrineMigrationsBundle](https://github.com/doctrine/DoctrineMigrationsBundle). Autodetect your foreign keys and update them. Supported databases: **MySQL, Postgres**.

Installation
------------

[](#installation)

```
composer require cap-collectif/id-to-uuid
# install for postgres support
composer require ramsey/uuid

```

Usage
-----

[](#usage)

1. Update your `id` column from `integer` to `guid`:

```
# User.orm.xml

---
---
+++
+++

 #...

```

Alternatively you can use [uuid-doctrine](https://github.com/ramsey/uuid-doctrine) to add `uuid` type support.

```

```

2. Add a new migration:

```
// app/DoctrineMigrations/VersionXYZ.php
