
-- CREATE TABLE "sub_sub_blocks" ---------------------------------------
CREATE TABLE "public"."sub_sub_blocks" ( 
	"id" Serial NOT NULL,
	"title" Character Varying DEFAULT '255' NOT NULL,
	"key" Character Varying( 255 ) NOT NULL,
	PRIMARY KEY ( "id" ) );
 ;
-- -------------------------------------------------------------

-- CREATE FIELD "sub_block_items_id" ---------------------------
ALTER TABLE "public"."sub_sub_blocks" ADD COLUMN "sub_block_items_id" Integer NOT NULL;
-- -------------------------------------------------------------

-- CREATE INDEX "index_sub_block_items_id" ---------------------
CREATE INDEX "index_sub_block_items_id" ON "public"."sub_sub_blocks" USING btree( "sub_block_items_id" );
-- -------------------------------------------------------------

-- CREATE LINK "public.sub_sub_blocks.lnk_sub_block_items_sub_sub_blocks" 
ALTER TABLE "public"."sub_sub_blocks"
	ADD CONSTRAINT "lnk_sub_block_items_sub_sub_blocks" FOREIGN KEY ( "sub_block_items_id" )
	REFERENCES "public"."sub_block_items" ( "id" ) MATCH FULL
	ON DELETE Cascade
	ON UPDATE Cascade;
-- -------------------------------------------------------------

-- CREATE TABLE "sub_sub_block_items" ----------------------------------
CREATE TABLE "public"."sub_sub_block_items" ( 
	"id" Serial NOT NULL,
	"number" Integer NOT NULL,
	"customize_speed" Boolean DEFAULT false NOT NULL,
	"customize_data" Boolean DEFAULT false NOT NULL,
	"configure_speed_multiplier" Boolean DEFAULT false NOT NULL,
	"configure_data_multiplier" Boolean DEFAULT false NOT NULL,
	"speed_up" Integer,
	"speed_down" Integer,
	"download_limit" Integer,
	"speed_multiplier" Numeric( 5, 2 ),
	"data_multiplier" Numeric( 5, 2 ),
	PRIMARY KEY ( "id" ) );
 ;
-- -------------------------------------------------------------

-- CREATE FIELD "has_configuration" ----------------------------
ALTER TABLE "public"."sub_sub_block_items" ADD COLUMN "has_configuration" Boolean DEFAULT false NOT NULL;
-- -------------------------------------------------------------

-- CREATE FIELD "sub_sub_blocks_id" ------------------------------------
ALTER TABLE "public"."sub_sub_block_items" ADD COLUMN "sub_sub_blocks_id" Integer NOT NULL;
-- -------------------------------------------------------------

-- CREATE INDEX "index_sub_sub_blocks_id" ------------------------------
CREATE INDEX "index_sub_sub_blocks_id" ON "public"."sub_sub_block_items" USING btree( "sub_sub_blocks_id" );
-- -------------------------------------------------------------

-- CREATE LINK "public.sub_sub_block_items.lnk_sub_sub_blocks_sub_sub_block_items" -----
ALTER TABLE "public"."sub_sub_block_items"
	ADD CONSTRAINT "lnk_sub_sub_blocks_sub_sub_block_items" FOREIGN KEY ( "sub_sub_blocks_id" )
	REFERENCES "public"."sub_sub_blocks" ( "id" ) MATCH FULL
	ON DELETE Cascade
	ON UPDATE Cascade;
-- -------------------------------------------------------------
-- CREATE FIELD "handler_generic" ------------------------------
ALTER TABLE "public"."sub_sub_block_items" ADD COLUMN "handler_generic" Boolean DEFAULT false NOT NULL;
-- -------------------------------------------------------------

-- CREATE FIELD "handler_detailed" -----------------------------
ALTER TABLE "public"."sub_sub_block_items" ADD COLUMN "handler_detailed" Boolean DEFAULT false NOT NULL;
-- -------------------------------------------------------------

-- CREATE FIELD "days_monday" ----------------------------------
ALTER TABLE "public"."sub_sub_block_items" ADD COLUMN "days_monday" Boolean DEFAULT false NOT NULL;
-- -------------------------------------------------------------

-- CREATE FIELD "days_tuesday" ---------------------------------
ALTER TABLE "public"."sub_sub_block_items" ADD COLUMN "days_tuesday" Boolean DEFAULT false NOT NULL;
-- -------------------------------------------------------------

-- CREATE FIELD "days_wednesday" -------------------------------
ALTER TABLE "public"."sub_sub_block_items" ADD COLUMN "days_wednesday" Boolean DEFAULT false NOT NULL;
-- -------------------------------------------------------------

-- CREATE FIELD "days_thursday" --------------------------------
ALTER TABLE "public"."sub_sub_block_items" ADD COLUMN "days_thursday" Boolean DEFAULT false NOT NULL;
-- -------------------------------------------------------------

-- CREATE FIELD "days_friday" ----------------------------------
ALTER TABLE "public"."sub_sub_block_items" ADD COLUMN "days_friday" Boolean DEFAULT false NOT NULL;
-- -------------------------------------------------------------

-- CREATE FIELD "days_saturday" --------------------------------
ALTER TABLE "public"."sub_sub_block_items" ADD COLUMN "days_saturday" Boolean DEFAULT false NOT NULL;
-- -------------------------------------------------------------

-- CREATE FIELD "days_sunday" ----------------------------------
ALTER TABLE "public"."sub_sub_block_items" ADD COLUMN "days_sunday" Boolean DEFAULT false NOT NULL;
-- -------------------------------------------------------------

