Skip to content

Commit

Permalink
Revert "Weird test to revert if not working"
Browse files Browse the repository at this point in the history
This reverts commit 8df5335.
  • Loading branch information
Vianpyro committed Nov 12, 2024
1 parent 8df5335 commit 5c83f3c
Showing 1 changed file with 0 additions and 108 deletions.
108 changes: 0 additions & 108 deletions create_get_procedures.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,20 @@ BEGIN
SELECT player_id, player_name, email, gold, created_at, last_login FROM player;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_player_by_id(IN player_id INT)
BEGIN
SELECT player_id, player_name, email, gold, created_at, last_login
FROM player
WHERE id = player_id;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_player_by_name(IN player_name VARCHAR(100))
BEGIN
SELECT player_id, player_name, email, gold, created_at, last_login
FROM player
WHERE player_name = player_name;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_player_worlds(IN player_id INT)
BEGIN
SELECT w.world_id, w.world_name, w.world_description, w.created_at
Expand All @@ -44,21 +32,13 @@ BEGIN
WHERE pw.player_id = player_id;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_player_cities(IN player_id INT)
BEGIN
SELECT c.city_id, c.city_name, c.x, c.y, c.island_id
FROM city c
WHERE c.owner_id = player_id;
END //

DELIMITER ;

DELIMITER //

-- World Procedures

CREATE OR REPLACE PROCEDURE get_all_worlds()
Expand All @@ -68,10 +48,6 @@ BEGIN
FROM world;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_world_by_id(IN world_id INT)
BEGIN
SELECT world_id, world_name, world_description, seed, action_speed, unit_speed, trade_speed,
Expand All @@ -80,21 +56,13 @@ BEGIN
WHERE world_id = world_id;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_active_worlds()
BEGIN
SELECT world_id, world_name, world_description, created_at
FROM world
WHERE STATUS = 1;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_players_in_world(IN world_id INT)
BEGIN
SELECT p.player_id, p.player_name, p.email, p.gold, p.created_at
Expand All @@ -103,21 +71,13 @@ BEGIN
WHERE pw.world_id = world_id;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_world_islands(IN world_id INT)
BEGIN
SELECT island_id, x, y
FROM island
WHERE world_id = world_id;
END //

DELIMITER ;

DELIMITER //

-- Island Procedures

CREATE OR REPLACE PROCEDURE get_all_islands()
Expand All @@ -126,32 +86,20 @@ BEGIN
FROM island;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_island_by_id(IN island_id INT)
BEGIN
SELECT island_id, x, y, world_id
FROM island
WHERE island_id = island_id;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_island_cities(IN island_id INT)
BEGIN
SELECT city_id, city_name, x, y, owner_id
FROM city
WHERE island_id = island_id;
END //

DELIMITER ;

DELIMITER //

-- City Procedures

CREATE OR REPLACE PROCEDURE get_all_cities()
Expand All @@ -160,21 +108,13 @@ BEGIN
FROM city;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_city_by_id(IN city_id INT)
BEGIN
SELECT city_id, city_name, x, y, island_id, owner_id
FROM city
WHERE id = city_id;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_cities_in_world(IN world_id INT)
BEGIN
SELECT c.city_id, c.city_name, c.x, c.y, c.owner_id, c.island_id
Expand All @@ -183,10 +123,6 @@ BEGIN
WHERE i.world_id = world_id;
END //

DELIMITER ;

DELIMITER //

-- Building Procedures

CREATE OR REPLACE PROCEDURE get_all_buildings()
Expand All @@ -195,43 +131,27 @@ BEGIN
FROM building;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_city_buildings(IN city_id INT)
BEGIN
SELECT building_id, building_name, building_level, max_level
FROM building
WHERE city_id = city_id;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_building_by_id(IN building_id INT)
BEGIN
SELECT building_id, building_name, building_level, max_level, city_id
FROM building
WHERE id = building_id;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_building_prerequisites(IN building_id INT)
BEGIN
SELECT prerequisite_id
FROM building_prerequisite
WHERE building_id = building_id;
END //

DELIMITER ;

DELIMITER //

-- Unit Procedures

CREATE OR REPLACE PROCEDURE get_all_units()
Expand All @@ -242,10 +162,6 @@ BEGIN
FROM unit;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_city_units(IN city_id INT)
BEGIN
SELECT u.unit_id, u.unit_name, cu.quantity
Expand All @@ -254,10 +170,6 @@ BEGIN
WHERE cu.city_id = city_id;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_unit_by_id(IN unit_id INT)
BEGIN
SELECT unit_id, unit_name, unit_description, unit_type, wood_cost, stone_cost, silver_cost,
Expand All @@ -267,10 +179,6 @@ BEGIN
WHERE id = unit_id;
END //

DELIMITER ;

DELIMITER //

-- Battle Procedures

CREATE OR REPLACE PROCEDURE get_all_battles()
Expand All @@ -280,10 +188,6 @@ BEGIN
FROM battle;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_battle_by_id(IN battle_id INT)
BEGIN
SELECT battle_id, attacker_id, defender_id, battle_time, winner_id, loser_id, loot_wood,
Expand All @@ -292,10 +196,6 @@ BEGIN
WHERE id = battle_id;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_player_battles(IN player_id INT)
BEGIN
SELECT battle_id, attacker_id, defender_id, battle_time, winner_id, loser_id, loot_wood,
Expand All @@ -304,21 +204,13 @@ BEGIN
WHERE attacker_id = player_id OR defender_id = player_id;
END //

DELIMITER ;

DELIMITER //

CREATE OR REPLACE PROCEDURE get_battle_units(IN battle_id INT)
BEGIN
SELECT unit_id, quantity, side
FROM battle_unit
WHERE battle_id = battle_id;
END //

DELIMITER ;

DELIMITER //

-- Miscellaneous Procedures

CREATE OR REPLACE PROCEDURE get_building_requirements(IN building_id INT)
Expand Down

0 comments on commit 5c83f3c

Please sign in to comment.