BEGIN;
CREATE sequence supplies_package_id_supplies_package_seq;
-- CREATE TABLE "supplies_package" -----------------------------
CREATE TABLE "public"."supplies_package" ( 
	"id_contratos_examenes" SmallInt NOT NULL,
	"id_package" Bigint NOT NULL,
	"id_supplies_package" Bigint DEFAULT nextval('supplies_package_id_supplies_package_seq'::regclass) NOT NULL,
	PRIMARY KEY ( "id_supplies_package" ) );
 ;
-- -------------------------------------------------------------

COMMIT;

BEGIN;

-- CREATE LINK "lnk_package_in_package" ------------------------
ALTER TABLE "public"."supplies_package"
	ADD CONSTRAINT "lnk_package_in_package" FOREIGN KEY ( "id_package" )
	REFERENCES "public"."package" ( "id_package" ) MATCH FULL
	ON DELETE Cascade
	ON UPDATE Cascade;
-- -------------------------------------------------------------

COMMIT;

BEGIN;

-- CREATE LINK "lnk_contratos_examenes_in_package" -------------
ALTER TABLE "public"."supplies_package"
	ADD CONSTRAINT "lnk_contratos_examenes_in_package" FOREIGN KEY ( "id_contratos_examenes" )
	REFERENCES "public"."contratos_examenes" ( "id_contratos_examenes" ) MATCH FULL
	ON DELETE Cascade
	ON UPDATE Cascade;
-- -------------------------------------------------------------

COMMIT;