+ unique (version, blueprint_id)
+);
+
+CREATE TABLE blueprint_instance_blueprint_layer
+(
+ blueprint_instance_id bigint not NULL,
+ blueprint_layer_id bigint not NULL,
+ CONSTRAINT blueprint_instance_id_fk2 FOREIGN KEY (blueprint_instance_id)
+ REFERENCES blueprint_instance (id) MATCH SIMPLE
+ ON UPDATE NO ACTION ON DELETE NO ACTION,
+ CONSTRAINT blueprint_layer_id_fk FOREIGN KEY (blueprint_layer_id)
+ REFERENCES blueprint_layer (id) MATCH SIMPLE
+ ON UPDATE NO ACTION ON DELETE NO ACTION,
+ unique (blueprint_instance_id, blueprint_layer_id)
+);
+
+CREATE TABLE blueprint_instance_timeslot
+(
+ blueprint_instance_id bigint not NULL,
+ timeslot_id bigint not NULL,
+ CONSTRAINT blueprint_instance_id_fk3 FOREIGN KEY (blueprint_instance_id)
+ REFERENCES blueprint_instance (id) MATCH SIMPLE
+ ON UPDATE NO ACTION ON DELETE NO ACTION,
+ CONSTRAINT timeslot_id_fk FOREIGN KEY (timeslot_id)
+ REFERENCES timeslot (id) MATCH SIMPLE
+ ON UPDATE NO ACTION ON DELETE NO ACTION,
+ unique (blueprint_instance_id, timeslot_id)