drop table if exists member_templates;
create table member_templates(
	member_template_id serial not null,
	member_id integer not null references members( member_id ),
	ctstamp timestamp without time zone not null default now(),
	mtstamp timestamp without time zone,
	template_title varchar(255),
	template_price varchar(64),
	template_text text,
	constraint member_templates_member_template_id_pkey primary key( member_template_id )
);

comment on table member_templates is 'storage of member templates';
comment on column member_templates.member_template_id is 'unique id of table';
comment on column member_templates.member_id is 'reference id to members table';
comment on column member_templates.ctstamp is 'creation timestamp of template';
comment on column member_templates.mtstamp is 'modification timestamp of template';
comment on column member_templates.template_title is 'title of the template';
comment on column member_templates.template_price is 'price of the template';
comment on column member_templates.template_text is 'text of the template';

comment on constraint member_templates_member_template_id_pkey on member_templates is 'unique constraint on table';
comment on constraint member_templates_member_id_fkey on member_templates is 'foreign constraint to members table';
