# Default to UUID orimary key via app settings

**URL:** <https://discourse.hanakai.org/t/default-to-uuid-orimary-key-via-app-settings/458>\
**Category:** proposals\
**Created:** [August 6, 2018, 11:53pm UTC](https://discourse.hanakai.org/t/default-to-uuid-orimary-key-via-app-settings/458 "2018-08-06T23:53:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jc00ke](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.hanakai.org/jc00ke/32/422_2.png) [@jc00ke](https://discourse.hanakai.org/u/jc00ke)\
**Post date:** [August 6, 2018, 11:53pm UTC](https://discourse.hanakai.org/t/default-to-uuid-orimary-key-via-app-settings/458/1 "2018-08-06T23:53:41Z")

</div>

I asked about this [years ago](https://github.com/hanami/utils/issues/60), and [I see it’s possible](https://github.com/hanami/hanami.github.io/pull/130) to use a `UUID` as the primary key, but I’d like to propose we add an app setting to `.hanamirc` that will default primary keys in generated migrations to `UUID`. If it’s not amenable to support a `UUID` type or a `:uuid` column type w/o the call to `Hanami::Model::Sql.function(:uuid_generate_v4)` then I think it would at least be a better dev experience to inject that when generating the migration.

Thoughts?
