[Bucardo-general] Tables with no primary key.

Greg Sabino Mullane greg at endpoint.com
Sat Oct 22 03:15:07 UTC 2016

On Fri, Oct 21, 2016 at 11:29:22AM -0700, Periko Support wrote:
> In odoo 7 db, we have this tables without pkey:
> public.ir_model_relation
> public.wkf_witm_trans
> I ask to our developers if we can add pkey to those tables, but they
> didn't want to touch them because they are odoo internal tables.
> Someone in the past with this issue?
> I want to add pkey but don't know if this will affect odoo operation,
> those tables are empty.

It should be fine to add a primary key and a unique index to those tables, 
as more recent versions of Odoo already contain them. Here are the 

ALTER TABLE ir_model_relation
    ADD CONSTRAINT ir_model_relation_pkey PRIMARY KEY (id);

ALTER TABLE wkf_witm_trans
    ADD CONSTRAINT wkf_witm_trans_inst_id_trans_id_key UNIQUE (inst_id, trans_id);

Upgrading to Odoo 8 will also provide those changes, although that may 
be a little more involved than running those two statemnts. :)

Greg Sabino Mullane greg at endpoint.com
End Point Corporation
PGP Key: 2529 DF6A B8F7 9407 E944  45B4 BC9B 9067 1496 4AC8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20161021/702b46f0/attachment.sig>

More information about the Bucardo-general mailing list