 comment on column users_workflow.status is 'Record status: to correct, to be corrected or published';
 comment on column users_workflow.modification_date_time is 'Date and time of status change - last date/time is used as actual status, but helps also to keep an history of status change';
 comment on column users_workflow.comment is 'Complementary comments';
+
+create sequence users_tables_fields_tracked_id_seq;
+
 create table users_tables_fields_tracked
        (
+	id integer not null default nextval('users_tables_fields_tracked_id_seq'),
         referenced_relation varchar not null,
         field_name varchar not null,
         user_ref integer not null,
+	constraint pk_users_tables_fields_tracked primary key (id),
         constraint unq_users_tables_fields_tracked unique (referenced_relation, field_name, user_ref),
         constraint fk_users_tables_fields_tracked_users foreign key (user_ref) references users(id) on delete cascade
        );

comment on column collection_maintenance.description_ts is 'tsvector form of description field';
comment on column collection_maintenance.language_full_text is 'Language used by to_tsvector full text search function';
comment on column collection_maintenance.modification_date_time is 'Last update date/time';
create table my_saved_searches
       (
        user_ref integer not null,
        name varchar not null default 'default',
        search_criterias varchar not null,
        favorite boolean not null default false,
        modification_date_time update_date_time,
        visible_fields_in_result varchar not null,
        constraint unq_my_saved_searches unique (user_ref, name),
        constraint fk_my_saved_searches_users foreign key (user_ref) references users(id) on delete cascade
       );

	is_available boolean not null default false,
        icon_ref integer,
        title_perso varchar(32),
        constraint pk_my_preferences primary key (id),
        constraint unq_my_preferences unique (user_ref, category, group_name),
        constraint fk_my_preferences_users foreign key (user_ref) references users(id) on delete cascade,
        constraint fk_my_preferences_multimedia foreign key (icon_ref) references multimedia(id)
