diff --git a/create_get_procedures.sql b/create_get_procedures.sql index 43cf0b3..2018633 100644 --- a/create_get_procedures.sql +++ b/create_get_procedures.sql @@ -10,10 +10,6 @@ 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 @@ -21,10 +17,6 @@ BEGIN 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 @@ -32,10 +24,6 @@ BEGIN 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 @@ -44,10 +32,6 @@ 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 @@ -55,10 +39,6 @@ BEGIN WHERE c.owner_id = player_id; END // -DELIMITER ; - -DELIMITER // - -- World Procedures CREATE OR REPLACE PROCEDURE get_all_worlds() @@ -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, @@ -80,10 +56,6 @@ 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 @@ -91,10 +63,6 @@ BEGIN 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 @@ -103,10 +71,6 @@ 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 @@ -114,10 +78,6 @@ BEGIN WHERE world_id = world_id; END // -DELIMITER ; - -DELIMITER // - -- Island Procedures CREATE OR REPLACE PROCEDURE get_all_islands() @@ -126,10 +86,6 @@ 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 @@ -137,10 +93,6 @@ BEGIN 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 @@ -148,10 +100,6 @@ BEGIN WHERE island_id = island_id; END // -DELIMITER ; - -DELIMITER // - -- City Procedures CREATE OR REPLACE PROCEDURE get_all_cities() @@ -160,10 +108,6 @@ 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 @@ -171,10 +115,6 @@ BEGIN 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 @@ -183,10 +123,6 @@ BEGIN WHERE i.world_id = world_id; END // -DELIMITER ; - -DELIMITER // - -- Building Procedures CREATE OR REPLACE PROCEDURE get_all_buildings() @@ -195,10 +131,6 @@ 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 @@ -206,10 +138,6 @@ BEGIN 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 @@ -217,10 +145,6 @@ BEGIN WHERE id = building_id; END // -DELIMITER ; - -DELIMITER // - CREATE OR REPLACE PROCEDURE get_building_prerequisites(IN building_id INT) BEGIN SELECT prerequisite_id @@ -228,10 +152,6 @@ BEGIN WHERE building_id = building_id; END // -DELIMITER ; - -DELIMITER // - -- Unit Procedures CREATE OR REPLACE PROCEDURE get_all_units() @@ -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 @@ -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, @@ -267,10 +179,6 @@ BEGIN WHERE id = unit_id; END // -DELIMITER ; - -DELIMITER // - -- Battle Procedures CREATE OR REPLACE PROCEDURE get_all_battles() @@ -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, @@ -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, @@ -304,10 +204,6 @@ 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 @@ -315,10 +211,6 @@ BEGIN WHERE battle_id = battle_id; END // -DELIMITER ; - -DELIMITER // - -- Miscellaneous Procedures CREATE OR REPLACE PROCEDURE get_building_requirements(IN building_id INT)