ALTER TABLE tables ADD CONSTRAINT tables_pk PRIMARY KEY ( id );

ALTER TABLE tables ADD CONSTRAINT tables_owner_name UNIQUE ( name,
                                                             owner_id );

ALTER TABLE tables ADD CONSTRAINT tables_slug UNIQUE ( slug );