PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE `delas` (
	`ID` integer PRIMARY KEY,
	`dID` text NOT NULL UNIQUE,
	`name` text NOT NULL,
	`location` text NOT NULL,
	`revolutUsername` text NOT NULL,
	`date` integer NOT NULL,
	`createdAt` integer NOT NULL
);
INSERT INTO delas VALUES(1,'aUyw9vND','Spesa Serata Toast','Basko - Via Angelo Carrara 260','rcastellotti00',1782918996248,1786304451776);
INSERT INTO delas VALUES(2,'Eedkpzkz','Spesa Serata Toast 2','Basko - Via Angelo Carrara 260','rcastellotti00',1782918996248,1786465631303);
CREATE TABLE `items` (
	`ID` integer PRIMARY KEY,
	`delaID` integer NOT NULL,
	`name` text NOT NULL,
	`price` integer NOT NULL,
	`splits` integer NOT NULL,
	CONSTRAINT `fk_items_delaID_delas_ID_fk` FOREIGN KEY (`delaID`) REFERENCES `delas`(`ID`) ON DELETE CASCADE
);
INSERT INTO items VALUES(1,1,'Pringles XXL Paprika G.200',289,5);
INSERT INTO items VALUES(2,1,'Eldorada G.130 Amica Chips',138,5);
INSERT INTO items VALUES(3,1,'Birra cl.60 Beck''s Bott',169,3);
INSERT INTO items VALUES(4,1,'Birra cl.60 Beck''s Bott',169,3);
INSERT INTO items VALUES(5,1,'Birra cl.60 Beck''s Bott',169,3);
INSERT INTO items VALUES(6,1,'Birra cl.60 Beck''s Bott',169,3);
INSERT INTO items VALUES(7,1,'Birra cl.60 Beck''s Bott',169,3);
INSERT INTO items VALUES(8,1,'Birra cl.60 Beck''s Bott',169,3);
INSERT INTO items VALUES(9,1,'Birra cl.60 Beck''s Bott',169,3);
INSERT INTO items VALUES(10,1,'Birra cl.60 Beck''s Bott',169,3);
INSERT INTO items VALUES(11,1,'Tortilla Chips Paquita G.4',229,5);
INSERT INTO items VALUES(12,1,'Salame Milano affettato G.',229,5);
INSERT INTO items VALUES(13,1,'Salame Milano affettato G.',229,5);
INSERT INTO items VALUES(14,1,'Prosciutto Crudo Stella G.',399,5);
INSERT INTO items VALUES(15,1,'Prosciutto Crudo Stella G.',399,5);
INSERT INTO items VALUES(16,1,'Prosciutto Cotto A.Q.G.180',339,5);
INSERT INTO items VALUES(17,1,'Prosciutto Cotto A.Q.G.180',339,5);
INSERT INTO items VALUES(18,1,'Prosciutto Cotto A.Q.G.180',339,5);
INSERT INTO items VALUES(19,1,'American Sandwich G.550 PR',118,5);
INSERT INTO items VALUES(20,1,'American Sandwich G.550 PR',118,5);
INSERT INTO items VALUES(21,1,'Iceberg G.350',189,5);
INSERT INTO items VALUES(22,1,'Pomodoro Cuore Di Bue Qual',112,5);
INSERT INTO items VALUES(23,1,'Form. Fuso Fette G.400 Prim',279,5);
INSERT INTO items VALUES(24,1,'Form. Fuso Fette G.400 Prim',279,5);
INSERT INTO items VALUES(25,1,'Maionese Orig. ML.400/G.395',349,5);
INSERT INTO items VALUES(26,1,'Fanta Strawberry+Kiwi cl.3',159,1);
INSERT INTO items VALUES(27,1,'Nutella G.400',399,1);
INSERT INTO items VALUES(28,2,'Pringles XXL Paprika G.200',289,5);
INSERT INTO items VALUES(29,2,'Eldorada G.130 Amica Chips',138,5);
INSERT INTO items VALUES(30,2,'Birra cl.60 Beck''s Bott',169,3);
INSERT INTO items VALUES(31,2,'Birra cl.60 Beck''s Bott',169,3);
INSERT INTO items VALUES(32,2,'Birra cl.60 Beck''s Bott',169,3);
INSERT INTO items VALUES(33,2,'Birra cl.60 Beck''s Bott',169,3);
INSERT INTO items VALUES(34,2,'Birra cl.60 Beck''s Bott',169,3);
INSERT INTO items VALUES(35,2,'Birra cl.60 Beck''s Bott',169,3);
INSERT INTO items VALUES(36,2,'Birra cl.60 Beck''s Bott',169,3);
INSERT INTO items VALUES(37,2,'Birra cl.60 Beck''s Bott',169,3);
INSERT INTO items VALUES(38,2,'Tortilla Chips Paquita G.4',229,5);
INSERT INTO items VALUES(39,2,'Salame Milano affettato G.',229,5);
INSERT INTO items VALUES(40,2,'Salame Milano affettato G.',229,5);
INSERT INTO items VALUES(41,2,'Prosciutto Crudo Stella G.',399,5);
INSERT INTO items VALUES(42,2,'Prosciutto Crudo Stella G.',399,5);
INSERT INTO items VALUES(43,2,'Prosciutto Cotto A.Q.G.180',339,5);
INSERT INTO items VALUES(44,2,'Prosciutto Cotto A.Q.G.180',339,5);
INSERT INTO items VALUES(45,2,'Prosciutto Cotto A.Q.G.180',339,5);
INSERT INTO items VALUES(46,2,'American Sandwich G.550 PR',118,5);
INSERT INTO items VALUES(47,2,'American Sandwich G.550 PR',118,5);
INSERT INTO items VALUES(48,2,'Iceberg G.350',189,5);
INSERT INTO items VALUES(49,2,'Pomodoro Cuore Di Bue Qual',112,5);
INSERT INTO items VALUES(50,2,'Form. Fuso Fette G.400 Prim',279,5);
INSERT INTO items VALUES(51,2,'Form. Fuso Fette G.400 Prim',279,5);
INSERT INTO items VALUES(52,2,'Maionese Orig. ML.400/G.395',349,5);
INSERT INTO items VALUES(53,2,'Fanta Strawberry+Kiwi cl.3',159,1);
INSERT INTO items VALUES(54,2,'Nutella G.400',399,1);
CREATE TABLE `participants` (
	`ID` integer PRIMARY KEY,
	`parID` text NOT NULL UNIQUE,
	`delaID` integer NOT NULL,
	`username` text NOT NULL,
	CONSTRAINT `fk_participants_delaID_delas_ID_fk` FOREIGN KEY (`delaID`) REFERENCES `delas`(`ID`) ON DELETE CASCADE
);
INSERT INTO participants VALUES(1,'ZK9uetML',1,'roberto');
INSERT INTO participants VALUES(2,'x0OOraYK',1,'simone');
INSERT INTO participants VALUES(3,'tECF1dLu',1,'mattia');
INSERT INTO participants VALUES(4,'xXE9ZqlM',1,'marco');
INSERT INTO participants VALUES(5,'RCcVMe3p',1,'federico');
INSERT INTO participants VALUES(6,'i0b4sbN7',2,'roberto');
INSERT INTO participants VALUES(7,'Jm1qZEY2',2,'simone');
INSERT INTO participants VALUES(8,'JQcteOcF',2,'mattia');
INSERT INTO participants VALUES(9,'EH1rxFlZ',2,'marco');
INSERT INTO participants VALUES(10,'Gmmi2EU0',2,'federico');
CREATE TABLE `paymentItems` (
	`paymentID` integer NOT NULL,
	`itemID` integer NOT NULL,
	`splitsPaid` integer NOT NULL,
	CONSTRAINT `paymentItems_pk` PRIMARY KEY(`paymentID`, `itemID`),
	CONSTRAINT `fk_paymentItems_paymentID_payments_ID_fk` FOREIGN KEY (`paymentID`) REFERENCES `payments`(`ID`) ON DELETE CASCADE,
	CONSTRAINT `fk_paymentItems_itemID_items_ID_fk` FOREIGN KEY (`itemID`) REFERENCES `items`(`ID`) ON DELETE CASCADE
);
INSERT INTO paymentItems VALUES(1,1,1);
INSERT INTO paymentItems VALUES(1,2,1);
INSERT INTO paymentItems VALUES(1,3,1);
INSERT INTO paymentItems VALUES(1,4,1);
INSERT INTO paymentItems VALUES(1,5,1);
INSERT INTO paymentItems VALUES(1,6,1);
INSERT INTO paymentItems VALUES(1,7,1);
INSERT INTO paymentItems VALUES(1,8,1);
INSERT INTO paymentItems VALUES(1,9,1);
INSERT INTO paymentItems VALUES(1,10,1);
INSERT INTO paymentItems VALUES(1,11,1);
INSERT INTO paymentItems VALUES(1,12,1);
INSERT INTO paymentItems VALUES(1,13,1);
INSERT INTO paymentItems VALUES(1,14,1);
INSERT INTO paymentItems VALUES(1,15,1);
INSERT INTO paymentItems VALUES(1,16,1);
INSERT INTO paymentItems VALUES(1,17,1);
INSERT INTO paymentItems VALUES(1,18,1);
INSERT INTO paymentItems VALUES(1,19,1);
INSERT INTO paymentItems VALUES(1,20,1);
INSERT INTO paymentItems VALUES(1,21,1);
INSERT INTO paymentItems VALUES(1,22,1);
INSERT INTO paymentItems VALUES(1,23,1);
INSERT INTO paymentItems VALUES(1,24,1);
INSERT INTO paymentItems VALUES(1,25,1);
INSERT INTO paymentItems VALUES(2,1,1);
INSERT INTO paymentItems VALUES(2,2,1);
INSERT INTO paymentItems VALUES(2,3,1);
INSERT INTO paymentItems VALUES(2,4,1);
INSERT INTO paymentItems VALUES(2,5,1);
INSERT INTO paymentItems VALUES(2,6,1);
INSERT INTO paymentItems VALUES(2,7,1);
INSERT INTO paymentItems VALUES(2,8,1);
INSERT INTO paymentItems VALUES(2,9,1);
INSERT INTO paymentItems VALUES(2,10,1);
INSERT INTO paymentItems VALUES(2,11,1);
INSERT INTO paymentItems VALUES(2,12,1);
INSERT INTO paymentItems VALUES(2,13,1);
INSERT INTO paymentItems VALUES(2,14,1);
INSERT INTO paymentItems VALUES(2,15,1);
INSERT INTO paymentItems VALUES(2,16,1);
INSERT INTO paymentItems VALUES(2,17,1);
INSERT INTO paymentItems VALUES(2,18,1);
INSERT INTO paymentItems VALUES(2,19,1);
INSERT INTO paymentItems VALUES(2,20,1);
INSERT INTO paymentItems VALUES(2,21,1);
INSERT INTO paymentItems VALUES(2,22,1);
INSERT INTO paymentItems VALUES(2,23,1);
INSERT INTO paymentItems VALUES(2,24,1);
INSERT INTO paymentItems VALUES(3,1,1);
INSERT INTO paymentItems VALUES(3,2,1);
INSERT INTO paymentItems VALUES(3,10,1);
INSERT INTO paymentItems VALUES(3,11,1);
INSERT INTO paymentItems VALUES(3,12,1);
INSERT INTO paymentItems VALUES(3,13,1);
INSERT INTO paymentItems VALUES(3,14,1);
INSERT INTO paymentItems VALUES(3,15,1);
INSERT INTO paymentItems VALUES(3,16,1);
INSERT INTO paymentItems VALUES(3,17,1);
INSERT INTO paymentItems VALUES(3,18,1);
INSERT INTO paymentItems VALUES(3,19,1);
INSERT INTO paymentItems VALUES(3,20,1);
INSERT INTO paymentItems VALUES(3,21,1);
INSERT INTO paymentItems VALUES(3,22,1);
INSERT INTO paymentItems VALUES(3,23,1);
INSERT INTO paymentItems VALUES(3,24,1);
INSERT INTO paymentItems VALUES(3,25,1);
INSERT INTO paymentItems VALUES(3,26,1);
INSERT INTO paymentItems VALUES(3,27,1);
INSERT INTO paymentItems VALUES(4,1,1);
INSERT INTO paymentItems VALUES(4,2,1);
INSERT INTO paymentItems VALUES(4,11,1);
INSERT INTO paymentItems VALUES(4,12,1);
INSERT INTO paymentItems VALUES(4,13,1);
INSERT INTO paymentItems VALUES(4,14,1);
INSERT INTO paymentItems VALUES(4,15,1);
INSERT INTO paymentItems VALUES(4,16,1);
INSERT INTO paymentItems VALUES(4,17,1);
INSERT INTO paymentItems VALUES(4,18,1);
INSERT INTO paymentItems VALUES(4,19,1);
INSERT INTO paymentItems VALUES(4,20,1);
INSERT INTO paymentItems VALUES(4,23,1);
INSERT INTO paymentItems VALUES(4,24,1);
INSERT INTO paymentItems VALUES(5,1,1);
INSERT INTO paymentItems VALUES(5,2,1);
INSERT INTO paymentItems VALUES(5,3,1);
INSERT INTO paymentItems VALUES(5,4,1);
INSERT INTO paymentItems VALUES(5,5,1);
INSERT INTO paymentItems VALUES(5,6,1);
INSERT INTO paymentItems VALUES(5,7,1);
INSERT INTO paymentItems VALUES(5,8,1);
INSERT INTO paymentItems VALUES(5,9,1);
INSERT INTO paymentItems VALUES(5,11,1);
INSERT INTO paymentItems VALUES(5,12,1);
INSERT INTO paymentItems VALUES(5,13,1);
INSERT INTO paymentItems VALUES(5,14,1);
INSERT INTO paymentItems VALUES(5,15,1);
INSERT INTO paymentItems VALUES(5,16,1);
INSERT INTO paymentItems VALUES(5,17,1);
INSERT INTO paymentItems VALUES(5,18,1);
INSERT INTO paymentItems VALUES(5,19,1);
INSERT INTO paymentItems VALUES(5,20,1);
INSERT INTO paymentItems VALUES(5,21,1);
INSERT INTO paymentItems VALUES(5,22,1);
INSERT INTO paymentItems VALUES(5,23,1);
INSERT INTO paymentItems VALUES(5,24,1);
INSERT INTO paymentItems VALUES(5,25,1);
INSERT INTO paymentItems VALUES(6,28,1);
INSERT INTO paymentItems VALUES(6,29,1);
INSERT INTO paymentItems VALUES(6,30,1);
INSERT INTO paymentItems VALUES(6,31,1);
INSERT INTO paymentItems VALUES(6,32,1);
INSERT INTO paymentItems VALUES(6,33,1);
INSERT INTO paymentItems VALUES(6,34,1);
INSERT INTO paymentItems VALUES(6,35,1);
INSERT INTO paymentItems VALUES(6,36,1);
INSERT INTO paymentItems VALUES(6,37,1);
INSERT INTO paymentItems VALUES(6,38,1);
INSERT INTO paymentItems VALUES(6,39,1);
INSERT INTO paymentItems VALUES(6,40,1);
INSERT INTO paymentItems VALUES(6,41,1);
INSERT INTO paymentItems VALUES(6,42,1);
INSERT INTO paymentItems VALUES(6,43,1);
INSERT INTO paymentItems VALUES(6,44,1);
INSERT INTO paymentItems VALUES(6,45,1);
INSERT INTO paymentItems VALUES(6,46,1);
INSERT INTO paymentItems VALUES(6,47,1);
INSERT INTO paymentItems VALUES(6,48,1);
INSERT INTO paymentItems VALUES(6,49,1);
INSERT INTO paymentItems VALUES(6,50,1);
INSERT INTO paymentItems VALUES(6,51,1);
INSERT INTO paymentItems VALUES(6,52,1);
INSERT INTO paymentItems VALUES(7,28,1);
INSERT INTO paymentItems VALUES(7,29,1);
INSERT INTO paymentItems VALUES(7,30,1);
INSERT INTO paymentItems VALUES(7,31,1);
INSERT INTO paymentItems VALUES(7,32,1);
INSERT INTO paymentItems VALUES(7,33,1);
INSERT INTO paymentItems VALUES(7,34,1);
INSERT INTO paymentItems VALUES(7,35,1);
INSERT INTO paymentItems VALUES(7,36,1);
INSERT INTO paymentItems VALUES(7,37,1);
INSERT INTO paymentItems VALUES(7,38,1);
INSERT INTO paymentItems VALUES(7,39,1);
INSERT INTO paymentItems VALUES(7,40,1);
INSERT INTO paymentItems VALUES(7,41,1);
INSERT INTO paymentItems VALUES(7,42,1);
INSERT INTO paymentItems VALUES(7,43,1);
INSERT INTO paymentItems VALUES(7,44,1);
INSERT INTO paymentItems VALUES(7,45,1);
INSERT INTO paymentItems VALUES(7,46,1);
INSERT INTO paymentItems VALUES(7,47,1);
INSERT INTO paymentItems VALUES(7,48,1);
INSERT INTO paymentItems VALUES(7,49,1);
INSERT INTO paymentItems VALUES(7,50,1);
INSERT INTO paymentItems VALUES(7,51,1);
INSERT INTO paymentItems VALUES(7,52,1);
INSERT INTO paymentItems VALUES(8,28,1);
INSERT INTO paymentItems VALUES(8,29,1);
INSERT INTO paymentItems VALUES(8,30,1);
INSERT INTO paymentItems VALUES(8,31,1);
INSERT INTO paymentItems VALUES(8,32,1);
INSERT INTO paymentItems VALUES(8,33,1);
INSERT INTO paymentItems VALUES(8,34,1);
INSERT INTO paymentItems VALUES(8,35,1);
INSERT INTO paymentItems VALUES(8,36,1);
INSERT INTO paymentItems VALUES(8,37,1);
INSERT INTO paymentItems VALUES(8,38,1);
INSERT INTO paymentItems VALUES(8,39,1);
INSERT INTO paymentItems VALUES(8,40,1);
INSERT INTO paymentItems VALUES(8,41,1);
INSERT INTO paymentItems VALUES(8,42,1);
INSERT INTO paymentItems VALUES(8,43,1);
INSERT INTO paymentItems VALUES(8,44,1);
INSERT INTO paymentItems VALUES(8,45,1);
INSERT INTO paymentItems VALUES(8,46,1);
INSERT INTO paymentItems VALUES(8,47,1);
INSERT INTO paymentItems VALUES(8,48,1);
INSERT INTO paymentItems VALUES(8,49,1);
INSERT INTO paymentItems VALUES(8,50,1);
INSERT INTO paymentItems VALUES(8,51,1);
INSERT INTO paymentItems VALUES(8,52,1);
INSERT INTO paymentItems VALUES(9,28,1);
INSERT INTO paymentItems VALUES(9,29,1);
INSERT INTO paymentItems VALUES(9,38,1);
INSERT INTO paymentItems VALUES(9,39,1);
INSERT INTO paymentItems VALUES(9,40,1);
INSERT INTO paymentItems VALUES(9,41,1);
INSERT INTO paymentItems VALUES(9,42,1);
INSERT INTO paymentItems VALUES(9,43,1);
INSERT INTO paymentItems VALUES(9,44,1);
INSERT INTO paymentItems VALUES(9,45,1);
INSERT INTO paymentItems VALUES(9,46,1);
INSERT INTO paymentItems VALUES(9,47,1);
INSERT INTO paymentItems VALUES(9,48,1);
INSERT INTO paymentItems VALUES(9,49,1);
INSERT INTO paymentItems VALUES(9,50,1);
INSERT INTO paymentItems VALUES(9,51,1);
INSERT INTO paymentItems VALUES(9,52,1);
INSERT INTO paymentItems VALUES(9,53,1);
INSERT INTO paymentItems VALUES(9,54,1);
INSERT INTO paymentItems VALUES(10,28,1);
INSERT INTO paymentItems VALUES(10,29,1);
INSERT INTO paymentItems VALUES(10,38,1);
INSERT INTO paymentItems VALUES(10,39,1);
INSERT INTO paymentItems VALUES(10,40,1);
INSERT INTO paymentItems VALUES(10,41,1);
INSERT INTO paymentItems VALUES(10,42,1);
INSERT INTO paymentItems VALUES(10,43,1);
INSERT INTO paymentItems VALUES(10,44,1);
INSERT INTO paymentItems VALUES(10,45,1);
INSERT INTO paymentItems VALUES(10,46,1);
INSERT INTO paymentItems VALUES(10,47,1);
INSERT INTO paymentItems VALUES(10,48,1);
INSERT INTO paymentItems VALUES(10,49,1);
INSERT INTO paymentItems VALUES(10,50,1);
INSERT INTO paymentItems VALUES(10,51,1);
INSERT INTO paymentItems VALUES(10,52,1);
CREATE TABLE `payments` (
	`ID` integer PRIMARY KEY,
	`parID` integer NOT NULL UNIQUE,
	`payID` text NOT NULL UNIQUE,
	`status` text DEFAULT 'unpaid' NOT NULL,
	`createdAt` integer NOT NULL,
	`updatedAt` integer NOT NULL
);
INSERT INTO payments VALUES(1,1,'l70LS45K','paid',1786304502196,1786304503949);
INSERT INTO payments VALUES(2,4,'6OX2U8PF','paid',1786304754774,1786304774436);
INSERT INTO payments VALUES(3,3,'V7vCx17t','paid',1786308968211,1786308993040);
INSERT INTO payments VALUES(4,5,'ePUb96YH','paid',1786312043243,1786312064589);
INSERT INTO payments VALUES(5,2,'fv39wSpg','paid',1786372206268,1786382787728);
INSERT INTO payments VALUES(6,6,'ysuScJcu','paid',1786465646130,1786465647814);
INSERT INTO payments VALUES(7,7,'zeFtX9gL','paid',1786465655624,1786465656852);
INSERT INTO payments VALUES(8,9,'OErcfNF6','paid',1786465669275,1786465670931);
INSERT INTO payments VALUES(9,8,'ghER7OOq','paid',1786465679445,1786465680604);
INSERT INTO payments VALUES(10,10,'qHY4wHRC','paid',1786465691121,1786465694112);
COMMIT;
