# Bake a Model with no Primary Key

**URL:** <https://discourse.cakephp.org/t/bake-a-model-with-no-primary-key/1315>\
**Category:** Need Help\
**Tags:** behavior\
**Created:** [October 11, 2016, 9:25pm UTC](https://discourse.cakephp.org/t/bake-a-model-with-no-primary-key/1315 "2016-10-11T21:25:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerome.oneil](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/jerome.oneil/32/376_2.png) [@jerome.oneil](https://discourse.cakephp.org/u/jerome.oneil)\
**Post date:** [October 11, 2016, 9:25pm UTC](https://discourse.cakephp.org/t/bake-a-model-with-no-primary-key/1315/1 "2016-10-11T21:25:35Z")

</div>

I’m attempting to bake a model based on a materialized view. Postgres doesn’t support constraints on views, so bake is complaining about not having a primary key. The view is in all other ways conformant to Cake conventions.

Is there a way around this?
