text: CREATE SCHEMA PUBLIC;
  
  CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_4C812574_929C_4D8E_99D5_F15DC81FCD11 START WITH 3;
  
  CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_78F9F3F8_6B62_44B0_8067_DA53862AC221 START WITH 4;
  
  CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_83746C6B_E026_4024_9A5B_3D3AEAABD8D0 START WITH 8;
  
  CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_C1DEB659_36C0_4AB6_80CF_17F6466016C1 START WITH 8;
  
  CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_F159B250_2C80_4A34_A3C7_07D940E64E23 START WITH 7;
  
  CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_FC1C3F88_29E7_46D4_BB9C_4C6ABFF9FBAC START WITH 1;
  
  CREATE TABLE PUBLIC.TCKT_T_DISCOUNT ( 
  	ID                   bigint  DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_FC1C3F88_29E7_46D4_BB9C_4C6ABFF9FBAC) NOT NULL,
  	AMOUNT               double   ,
  	DESCRIPTION          varchar(255)   ,
  	NAME                 varchar(255)   ,
  	PERCENTAGE           double   ,
  	CONSTRAINT CONSTRAINT_A PRIMARY KEY ( ID )
   );
  
  CREATE TABLE PUBLIC.TCKT_T_PURCHASE ( 
  	ID                   bigint  DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_4C812574_929C_4D8E_99D5_F15DC81FCD11) NOT NULL,
  	DATE                 timestamp   ,
  	TOTAL_AMOUNT         double   ,
  	DISCOUNT             bigint   ,
  	CONSTRAINT CONSTRAINT_4 PRIMARY KEY ( ID )
   );
  
  CREATE INDEX FK9CE792F3D4F5DFDB_INDEX_4 ON PUBLIC.TCKT_T_PURCHASE ( DISCOUNT );
  
  CREATE TABLE PUBLIC.TCKT_T_SERVICE ( 
  	ID                   bigint  DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_F159B250_2C80_4A34_A3C7_07D940E64E23) NOT NULL,
  	NAME                 varchar(255)   ,
  	PRICE                double   ,
  	CONSTRAINT CONSTRAINT_2 PRIMARY KEY ( ID )
   );
  
  CREATE TABLE PUBLIC.TCKT_T_PURCHASE_TICKET_LIST ( 
  	TCKT_T_PURCHASE      bigint   NOT NULL,
  	TICKETLIST           bigint   NOT NULL,
  	CONSTRAINT CONSTRAINT_INDEX_6 UNIQUE ( TICKETLIST ) 
   );
  
  CREATE INDEX FK8AF222A5B9358D4D_INDEX_6 ON PUBLIC.TCKT_T_PURCHASE_TICKET_LIST ( TCKT_T_PURCHASE );
  
  CREATE TABLE PUBLIC.TCKT_T_SUBSCRIBER ( 
  	ID                   bigint  DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_C1DEB659_36C0_4AB6_80CF_17F6466016C1) NOT NULL,
  	BIRTH_DATE           timestamp   ,
  	EMAIL                varchar(255)   ,
  	FIRST_LAST_NAME      varchar(255)   ,
  	TELEPHONE_NUMBER     varchar(255)   ,
  	SUBSCRIPTION         bigint   ,
  	CONSTRAINT CONSTRAINT_E PRIMARY KEY ( ID )
   );
  
  CREATE INDEX FKA6DEA5DA8C755313_INDEX_E ON PUBLIC.TCKT_T_SUBSCRIBER ( SUBSCRIPTION );
  
  CREATE TABLE PUBLIC.TCKT_T_SUBSCRIPTION ( 
  	ID                   bigint  DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_83746C6B_E026_4024_9A5B_3D3AEAABD8D0) NOT NULL,
  	DATE                 timestamp   ,
  	PROGRESSIVE_NUMBER   bigint   ,
  	SUBSCRIBER           bigint   ,
  	CONSTRAINT CONSTRAINT_29 PRIMARY KEY ( ID )
   );
  
  CREATE INDEX FK6A989E0F9D949BE9_INDEX_2 ON PUBLIC.TCKT_T_SUBSCRIPTION ( SUBSCRIBER );
  
  CREATE TABLE PUBLIC.TCKT_T_TICKET ( 
  	ID                   bigint  DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_78F9F3F8_6B62_44B0_8067_DA53862AC221) NOT NULL,
  	BUYER_BIRTH_DATE     timestamp   ,
  	BUYER_NAME           varchar(255)   ,
  	CALCULATED_PRICE     double   NOT NULL,
  	DATE                 timestamp   ,
  	PRINT_DAY            varchar(255)   ,
  	PROGRESSIVE_NUMBER   varchar(255)   ,
  	SERVICE              bigint   ,
  	SUBSCRIPTION         bigint   ,
  	CONSTRAINT CONSTRAINT_5 PRIMARY KEY ( ID )
   );
  
  CREATE INDEX FK7EB5CD7E557208F1_INDEX_5 ON PUBLIC.TCKT_T_TICKET ( SERVICE );
  
  CREATE INDEX FK7EB5CD7E8C755313_INDEX_5 ON PUBLIC.TCKT_T_TICKET ( SUBSCRIPTION );
  
  ALTER TABLE PUBLIC.TCKT_T_PURCHASE ADD CONSTRAINT FK9CE792F3D4F5DFDB FOREIGN KEY ( DISCOUNT ) REFERENCES PUBLIC.TCKT_T_DISCOUNT( ID ) ON DELETE RESTRICT ON UPDATE RESTRICT;
  
  ALTER TABLE PUBLIC.TCKT_T_PURCHASE_TICKET_LIST ADD CONSTRAINT FK8AF222A5B9358D4D FOREIGN KEY ( TCKT_T_PURCHASE ) REFERENCES PUBLIC.TCKT_T_PURCHASE( ID ) ON DELETE RESTRICT ON UPDATE RESTRICT;
  
  ALTER TABLE PUBLIC.TCKT_T_PURCHASE_TICKET_LIST ADD CONSTRAINT FK8AF222A55423984F FOREIGN KEY ( TICKETLIST ) REFERENCES PUBLIC.TCKT_T_TICKET( ID ) ON DELETE RESTRICT ON UPDATE RESTRICT;
  
  ALTER TABLE PUBLIC.TCKT_T_SUBSCRIBER ADD CONSTRAINT FKA6DEA5DA8C755313 FOREIGN KEY ( SUBSCRIPTION ) REFERENCES PUBLIC.TCKT_T_SUBSCRIPTION( ID ) ON DELETE RESTRICT ON UPDATE RESTRICT;
  
  ALTER TABLE PUBLIC.TCKT_T_SUBSCRIPTION ADD CONSTRAINT FK6A989E0F9D949BE9 FOREIGN KEY ( SUBSCRIBER ) REFERENCES PUBLIC.TCKT_T_SUBSCRIBER( ID ) ON DELETE RESTRICT ON UPDATE RESTRICT;
  
  ALTER TABLE PUBLIC.TCKT_T_TICKET ADD CONSTRAINT FK7EB5CD7E557208F1 FOREIGN KEY ( SERVICE ) REFERENCES PUBLIC.TCKT_T_SERVICE( ID ) ON DELETE RESTRICT ON UPDATE RESTRICT;
  
  ALTER TABLE PUBLIC.TCKT_T_TICKET ADD CONSTRAINT FK7EB5CD7E8C755313 FOREIGN KEY ( SUBSCRIPTION ) REFERENCES PUBLIC.TCKT_T_SUBSCRIPTION( ID ) ON DELETE RESTRICT ON UPDATE RESTRICT;
  
  INSERT INTO PUBLIC.TCKT_T_SERVICE (ID,NAME,PRICE) VALUES (1,'Giornaliero',12.0);
  INSERT INTO PUBLIC.TCKT_T_SERVICE (ID,NAME,PRICE) VALUES (2,'Mattino',8.0);
  INSERT INTO PUBLIC.TCKT_T_SERVICE (ID,NAME,PRICE) VALUES (3,'Pomeridiano',8.0);
  INSERT INTO PUBLIC.TCKT_T_SERVICE (ID,NAME,PRICE) VALUES (4,'Tapis Roulant',6.0);
  INSERT INTO PUBLIC.TCKT_T_SERVICE (ID,NAME,PRICE) VALUES (5,'Fondo',3.0);
  INSERT INTO PUBLIC.TCKT_T_SERVICE (ID,NAME,PRICE) VALUES (6,'Accompagnatore',2.0);
  