diff --git a/resources/scripts/DDL/04_DDL_create_item_table.sql b/resources/scripts/DDL/04_DDL_create_item_table.sql index dadbcc8..41affc4 100644 --- a/resources/scripts/DDL/04_DDL_create_item_table.sql +++ b/resources/scripts/DDL/04_DDL_create_item_table.sql @@ -12,6 +12,5 @@ CREATE TABLE `ITEM` ( `END_DATE` TIMESTAMP(6), PRIMARY KEY (`ID_ITEM`), - CONSTRAINT `FK_INVENTORY_1` FOREIGN KEY (`INVENTORY`) REFERENCES `INVENTORY` (`ID_INVENTORY`), - UNIQUE KEY `NAME_UNIQUE` (`NAME`) + CONSTRAINT `FK_INVENTORY_1` FOREIGN KEY (`INVENTORY`) REFERENCES `INVENTORY` (`ID_INVENTORY`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; \ No newline at end of file diff --git a/resources/scripts/DML/01_DML_insert_inventory_table.sql b/resources/scripts/DML/01_DML_insert_inventory_table.sql index 99cd457..08fcf94 100644 --- a/resources/scripts/DML/01_DML_insert_inventory_table.sql +++ b/resources/scripts/DML/01_DML_insert_inventory_table.sql @@ -22,4 +22,26 @@ VALUES 123.00, -- COINS CURRENT_TIMESTAMP, NULL + ); + +INSERT INTO + `matcherapplication`.`inventory` ( + `ID_INVENTORY`, + `CASH`, + `COINS`, + `START_DATE`, + `END_DATE` +) +VALUES + ( + ( + SELECT + coalesce(MAX(`I`.`ID_INVENTORY`), 0) + 1 + FROM + `matcherapplication`.`inventory` `I` + ), + 321.00, -- CASH + 321.00, -- COINS + CURRENT_TIMESTAMP, + NULL ); \ No newline at end of file diff --git a/resources/scripts/DML/02_DML_insert_item_table.sql b/resources/scripts/DML/02_DML_insert_item_table.sql index efb542f..d03d9f7 100644 --- a/resources/scripts/DML/02_DML_insert_item_table.sql +++ b/resources/scripts/DML/02_DML_insert_item_table.sql @@ -72,4 +72,77 @@ VALUES 1, -- INVENTORY (assuming an existing ID_INVENTORY from the INVENTORY table) CURRENT_TIMESTAMP, NULL + ); + + +INSERT INTO + `matcherapplication`.`item` ( + `ID_ITEM`, + `NAME`, + `QUANTITY`, + `INVENTORY`, + `START_DATE`, + `END_DATE` +) +VALUES + ( + ( + SELECT + coalesce(MAX(`I`.`ID_ITEM`), 0) + 1 + FROM + `matcherapplication`.`item` `I` + ), + 'item_1', -- NAME + 5, -- QUANTITY + 2, -- INVENTORY (assuming an existing ID_INVENTORY from the INVENTORY table) + CURRENT_TIMESTAMP, + NULL + ); + +INSERT INTO + `matcherapplication`.`item` ( + `ID_ITEM`, + `NAME`, + `QUANTITY`, + `INVENTORY`, + `START_DATE`, + `END_DATE` +) +VALUES + ( + ( + SELECT + coalesce(MAX(`I`.`ID_ITEM`), 0) + 1 + FROM + `matcherapplication`.`item` `I` + ), + 'item_20', -- NAME + 7, -- QUANTITY + 2, -- INVENTORY (assuming an existing ID_INVENTORY from the INVENTORY table) + CURRENT_TIMESTAMP, + NULL + ); + +INSERT INTO + `matcherapplication`.`item` ( + `ID_ITEM`, + `NAME`, + `QUANTITY`, + `INVENTORY`, + `START_DATE`, + `END_DATE` +) +VALUES + ( + ( + SELECT + coalesce(MAX(`I`.`ID_ITEM`), 0) + 1 + FROM + `matcherapplication`.`item` `I` + ), + 'item_58', -- NAME + 2, -- QUANTITY + 2, -- INVENTORY (assuming an existing ID_INVENTORY from the INVENTORY table) + CURRENT_TIMESTAMP, + NULL ); \ No newline at end of file diff --git a/resources/scripts/DML/05_DML_insert_player_table.sql b/resources/scripts/DML/04_DML_insert_player_table.sql similarity index 50% rename from resources/scripts/DML/05_DML_insert_player_table.sql rename to resources/scripts/DML/04_DML_insert_player_table.sql index 899fdc3..bb7ee22 100644 --- a/resources/scripts/DML/05_DML_insert_player_table.sql +++ b/resources/scripts/DML/04_DML_insert_player_table.sql @@ -45,4 +45,49 @@ VALUES 1, -- INVENTORY (assuming the ID_INVENTORY from the INVENTORY table) 123456, -- CLAN (assuming an existing ID_CLAN from the CLAN table) 'mycustom' -- CUSTOM_FIELD + ); + +INSERT INTO + `matcherapplication`.`player` ( + `ID_PLAYER`, + `CREDENTIAL`, + `CREATED`, + `MODIFIED`, + `LAST_SESSION`, + `TOTAL_SPENT`, + `TOTAL_REFUND`, + `TOTAL_TRANSACTIONS`, + `LAST_PURCHASE`, + `LEVEL`, + `XP`, + `TOTAL_PLAYTIME`, + `COUNTRY`, + `LANGUAGE`, + `BIRTHDATE`, + `GENDER`, + `INVENTORY`, + `CLAN`, + `CUSTOM_FIELD` +) +VALUES + ( + UUID_TO_BIN('37483be2-98b7-11e7-90cf-082e5f28d836'), -- ID_PLAYER + 'samsung_credential', -- CREDENTIAL + '2021-01-10 13:37:17.000000', -- CREATED + '2021-01-23 13:37:17.000000', -- MODIFIED + '2021-01-23 13:37:17.000000', -- LAST_SESSION + 450.00, -- TOTAL_SPENT + 50.00, -- TOTAL_REFUND + 7, -- TOTAL_TRANSACTIONS + '2021-01-22 13:37:17.000000', -- LAST_PURCHASE + 8, -- LEVEL + 1000, -- XP + 144.00, -- TOTAL_PLAYTIME + 'RO', -- COUNTRY + 'ro', -- LANGUAGE + '2000-01-10 13:37:17.000000', -- BIRTHDATE + 'female', -- GENDER + 2, -- INVENTORY (assuming the ID_INVENTORY from the INVENTORY table) + 123456, -- CLAN (assuming an existing ID_CLAN from the CLAN table) + 'mycustom2' -- CUSTOM_FIELD ); \ No newline at end of file diff --git a/resources/scripts/DML/04_DML_insert_device_table.sql b/resources/scripts/DML/05_DML_insert_device_table.sql similarity index 51% rename from resources/scripts/DML/04_DML_insert_device_table.sql rename to resources/scripts/DML/05_DML_insert_device_table.sql index 27d9c30..493b7d4 100644 --- a/resources/scripts/DML/04_DML_insert_device_table.sql +++ b/resources/scripts/DML/05_DML_insert_device_table.sql @@ -26,4 +26,30 @@ VALUES '123', -- FIRMWARE CURRENT_TIMESTAMP, NULL + ); + +INSERT INTO + `matcherapplication`.`device` ( + `ID_DEVICE`, + `PLAYER`, + `MODEL`, + `CARRIER`, + `FIRMWARE`, + `START_DATE`, + `END_DATE` +) +VALUES + ( + ( + SELECT + coalesce(MAX(`D`.`ID_DEVICE`), 0) + 1 + FROM + `matcherapplication`.`device` `D` + ), + UUID_TO_BIN('37483be2-98b7-11e7-90cf-082e5f28d836'), -- PLAYER (assuming an existing ID_PLAYER from the PLAYER table) + 'samsung 22 ultra', -- MODEL + 'orange', -- CARRIER + '321', -- FIRMWARE + CURRENT_TIMESTAMP, + NULL ); \ No newline at end of file