create table template (
	id integer generated by default as identity (start with 1),
	appng_version varchar(255),
	description varchar(255),
	displayName varchar(255),
	long_desc varchar(255),
	name varchar(255),
	template_version varchar(255),
	timestamp varchar(255),
	version timestamp,
	primary key (id)
);

create table template_resource (
	id integer generated by default as identity (start with 1),
	bytes blob(2048),
	checksum varchar(255),
	file_version timestamp,
	name varchar(255),
	version timestamp,
	template_id integer,
	primary key (id)
);

alter table template_resource 
	add constraint FK__TEMPLATE_RESOURCE__TEMPLATE_ID 
	foreign key (template_id) 
	references template;