drop table if exists servicetype_units cascade;
create table servicetype_units(
	servicetype_unit_id serial,
	servicetype_unit_name varchar(16),
	servicetype_unit_min_q integer default 0,
	constraint servicetype_units_servicetype_unit_id_pkey primary key( servicetype_unit_id )
);

comment on table servicetype_units is 'storage of servicetype_units';
comment on column servicetype_units.servicetype_unit_id is 'unique id of servicetype unit';
comment on column servicetype_units.servicetype_unit_name is 'name of the servicetype unit';
comment on column servicetype_units.servicetype_min_q is 'minimum quantity of servicetype unit';

comment on constraint servicetype_units_servicetype_unit_id_pkey on servicetype_units is 'unique constraint of table';

insert into servicetype_units( servicetype_unit_name , servicetype_unit_min_q ) values ( 'character' , 160 );
insert into servicetype_units( servicetype_unit_name , servicetype_unit_min_q ) values ( 'word' , 20 );
insert into servicetype_units( servicetype_unit_name , servicetype_unit_min_q ) values ( 'page' , 1 );
insert into servicetype_units( servicetype_unit_name , servicetype_unit_min_q ) values ( 'hour' , 1 );
insert into servicetype_units( servicetype_unit_name , servicetype_unit_min_q ) values ( 'day' , 1 );
insert into servicetype_units( servicetype_unit_name ) values ( 'persistent' );
