Skip to content

Commit

Permalink
added more data in db for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
vladutmargineanu committed Jan 23, 2024
1 parent c05eb2b commit cc6f613
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 2 deletions.
3 changes: 1 addition & 2 deletions resources/scripts/DDL/04_DDL_create_item_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
22 changes: 22 additions & 0 deletions resources/scripts/DML/01_DML_insert_inventory_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
73 changes: 73 additions & 0 deletions resources/scripts/DML/02_DML_insert_item_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

0 comments on commit cc6f613

Please sign in to comment.