esameits24-26backend/initdb/01_schema.sql
AV77web 53509490f3
All checks were successful
Deploy to VPS / build (push) Successful in 15s
Deploy to VPS / deploy (push) Successful in 18s
modifica a 01_schema.sql e 02_seed.sql uguale all'app corrieri
2026-07-12 18:17:31 +02:00

28 lines
1.1 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- ============================================================
-- Schema tabelle esameits24-26
-- Allineato alle API: /utenti,
-- ============================================================
USE `esameits24-26`;
-- ------------------------------------------------------------
-- Tabella UTENTI
-- Ruoli: Operatore | Amministratore
-- ------------------------------------------------------------
CREATE TABLE IF NOT EXISTS utente (
UtenteID INT UNSIGNED NOT NULL AUTO_INCREMENT,
Nome VARCHAR(100) NOT NULL,
Cognome VARCHAR(100) NOT NULL,
Email VARCHAR(255) NOT NULL,
PasswordHash VARCHAR(255) NOT NULL COMMENT 'Password salvata come hash (es. bcrypt)',
Ruolo ENUM("Amministratore", "Operatore") NOT NULL DEFAULT "Operatore",
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (UtenteID),
UNIQUE KEY uk_utente_email (Email)
) ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_unicode_ci;