feat: implement MainForm component and set up routing; add user table schema and trigger in SQL

This commit is contained in:
2026-01-13 19:01:06 +01:00
parent 8a915ea5f5
commit ba1a221ef3
8 changed files with 151 additions and 23 deletions

24
backend/scheme.sql Normal file
View File

@@ -0,0 +1,24 @@
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(100) NOT NULL,
first_name VARCHAR(100) NOT NULL,
last_name VARCHAR(100) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
unique_key CHAR(25) NOT NULL UNIQUE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Trigger zur automatischen Generierung eines 25stelligen Keys
DELIMITER $
CREATE TRIGGER before_user_insert
BEFORE INSERT ON users
FOR EACH ROW
BEGIN
SET NEW.unique_key = SUBSTRING(
REPLACE(UUID(), '-', '')
-- UUID = 32 Zeichen, wir nehmen 25 davon
, 1, 25);
END$
DELIMITER ;