drop table if exists job_notifications;
create table job_notifications(
	job_notification_id serial,
	ctstamp timestamp without time zone not null default now(),
	job_id integer not null references jobs( job_id ),
	member_id integer not null references members( member_id ),
	send_status char(1) not null default '0',
	ststamp timestamp without time zone,
	constraint job_notifications_job_notification_id_pkey primary key(job_notification_id)
);

comment on table job_notifications is 'storage of job notifications to members';
comment on column job_notifications.job_notification_id is 'unique id of job_notification';
comment on column job_notifications.ctstamp is 'creation timestamp of job notification';
comment on column job_notifications.job_id is 'reference id to jobs table';
comment on column job_notifications.member_id is 'reference id to members table';
comment on column job_notifications.send_status is 'send status of job notification (0/S)';
comment on column job_notifications.ststamp is 'send timestamp of job notification';

comment on constraint job_notifications_job_notification_id_pkey on job_notifications is 'unique constraint of table';
comment on constraint job_notifications_job_id_fkey on job_notifications is 'foreign constraint to jobs table';
comment on constraint job_notifications_member_id_fkey on job_notifications is 'foreign constraint to members table';
