drop table if exists larticle_comments;

create table larticle_comments(
	larticle_comment_id serial not null,
	article_id integer not null references articles( article_id ),
	site_language_id integer not null references site_languages( site_language_id ),
	ctstamp timestamp without time zone not null default now(),
	user_id integer not null references users( user_id ),
	is_active boolean default true,
	is_public boolean default true,
	is_admin_acknowledged boolean default false,
	is_deleted boolean default false,
	message text,
	constraint larticle_comments_pkey primary key( larticle_comment_id )
);


comment on table larticle_comments is 'storage of language article comments';
comment on column larticle_comments.larticle_comment_id is 'unique id of table';
comment on column larticle_comments.article_id is 'reference id to articles table';
comment on column larticle_comments.site_language_id is 'reference id to site_language_id';
comment on column larticle_comments.ctstamp is 'time stamp of the message';
comment on column larticle_comments.user_id is 'reference id to users table';
comment on column larticle_comments.is_active is 'active flag of comment';
comment on column larticle_comments.is_public is 'public flag of comment';
comment on column larticle_comments.is_admin_acknowledged is 'admin acknowledged flag of comment';
comment on column larticle_comments.is_deleted is 'deleted flag of comment';
comment on column larticle_comments.message is 'the comment itself';

comment on constraint larticle_comments_pkey on larticle_comments is 'unique constraint of table';
comment on constraint larticle_comments_article_id_fkey on larticle_comments is 'foreign constraint to articles table';
comment on constraint larticle_comments_site_language_id_fkey on larticle_comments is 'foreign constraint to site_languages table';
comment on constraint larticle_comments_user_id_fkey on larticle_comments is 'foreign constraint to users table';
