Put the queries in their own file

This commit is contained in:
Joseph Ferano 2023-02-23 20:37:53 +07:00
parent 7c128cc540
commit e115b52db5
3 changed files with 36 additions and 38 deletions

View File

@ -12,7 +12,6 @@ INSERT INTO users(name) VALUES
('Plug'), ('Plug'),
('Upgrade'); ('Upgrade');
INSERT INTO bank_account(user_id, resource_id, balance) VALUES INSERT INTO bank_account(user_id, resource_id, balance) VALUES
(1, 1, 200), (1, 1, 200),
(1, 2, 175), (1, 2, 175),
@ -26,38 +25,3 @@ INSERT INTO store_item(name, currency, target_resource, price, claim_amount) VAL
('Drill 1C', 1, 3, 25, 500), ('Drill 1C', 1, 3, 25, 500),
('Drill 1D', 1, 4, 25, 500), ('Drill 1D', 1, 4, 25, 500),
('Drill 1E', 1, 5, 25, 500); ('Drill 1E', 1, 5, 25, 500);
SELECT staking_event.id,well_id,staking_event.source_id,
inventory_item_id,staking_event.created_at,expiration_at
FROM staking_event
INNER JOIN resource_well ON resource_well.id = well_id
INNER JOIN staking_source on staking_event.source_id = staking_source.id
WHERE staking_event.source_id = ? AND staking_source.user_id = ?;
SELECT name,init_supply
FROM resource_well
INNER JOIN resource ON resource.id = resource_well.resource_id
WHERE source_id = 1;
SELECT inventory_item.id,store_item_id, COUNT(upgrade_event.id) as upgrades
FROM inventory_item
LEFT JOIN upgrade_event ON inventory_item.id = upgrade_event.inventory_item_id
WHERE inventory_item.user_id = 1
GROUP BY inventory_item.id;
SELECT inventory_item.id,store_item_id
FROM inventory_item;
SELECT staking_event.id,well_id,staking_event.source_id,
inventory_item_id,staking_event.created_at,expiration_at
FROM staking_event
INNER JOIN staking_source on staking_event.source_id = staking_source.id
WHERE staking_event.source_id = 4 AND staking_source.user_id = 1;
SELECT staking_event.id, staking_event.well_id, staking_event.source_id,
staking_event.inventory_item_id, staking_event.duration_in_mins,
staking_event.created_at
FROM staking_event
LEFT JOIN claim_event ON staking_event.id = claim_event.staking_event_id
WHERE staking_event.source_id = 4 AND claim_event.staking_event_id IS NULL;

3
mm.py
View File

@ -301,8 +301,7 @@ def draw_moons():
def draw_panels(): def draw_panels():
screen_width, screen_height = glfw.get_video_mode(glfw.get_primary_monitor())[0] screen_width, screen_height = glfw.get_video_mode(glfw.get_primary_monitor())[0]
# Main # TODO: We probably don't need to create a "Main" window...
# TODO: This is probably not the right way to do this
im.set_next_window_size(screen_width, screen_height) im.set_next_window_size(screen_width, screen_height)
# Set the next window position to (0, 0) to make the window cover the entire screen # Set the next window position to (0, 0) to make the window cover the entire screen

35
queries.sql Normal file
View File

@ -0,0 +1,35 @@
SELECT staking_event.id,well_id,staking_event.source_id,
inventory_item_id,staking_event.created_at,expiration_at
FROM staking_event
INNER JOIN resource_well ON resource_well.id = well_id
INNER JOIN staking_source on staking_event.source_id = staking_source.id
WHERE staking_event.source_id = ? AND staking_source.user_id = ?;
SELECT name,init_supply
FROM resource_well
INNER JOIN resource ON resource.id = resource_well.resource_id
WHERE source_id = 1;
SELECT inventory_item.id,store_item_id, COUNT(upgrade_event.id) as upgrades
FROM inventory_item
LEFT JOIN upgrade_event ON inventory_item.id = upgrade_event.inventory_item_id
WHERE inventory_item.user_id = 1
GROUP BY inventory_item.id;
SELECT inventory_item.id,store_item_id
FROM inventory_item;
SELECT staking_event.id,well_id,staking_event.source_id,
inventory_item_id,staking_event.created_at,expiration_at
FROM staking_event
INNER JOIN staking_source on staking_event.source_id = staking_source.id
WHERE staking_event.source_id = 4 AND staking_source.user_id = 1;
SELECT staking_event.id, staking_event.well_id, staking_event.source_id,
staking_event.inventory_item_id, staking_event.duration_in_mins,
staking_event.created_at
FROM staking_event
LEFT JOIN claim_event ON staking_event.id = claim_event.staking_event_id
WHERE staking_event.source_id = 4 AND claim_event.staking_event_id IS NULL;
update staking_event set created_at = '2023-02-21 12:58:02';