Enhance database insertion logic to handle duplicates and ensure unique type names

This commit is contained in:
vista-man
2025-03-20 13:41:28 +01:00
parent 50cad302cf
commit 65d8752829
3 changed files with 13762 additions and 11 deletions

View File

@@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS pokemon (
-- Table to store Pokémon types
CREATE TABLE IF NOT EXISTS types (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(50) NOT NULL
name VARCHAR(50) NOT NULL UNIQUE
);
-- Table to store Pokémon abilities