esameits24-26backend/initdb/01_schema.sql
AV77web 2eb778c4a8
Some checks failed
Deploy to VPS / build (push) Failing after 22s
Deploy to VPS / deploy (push) Has been skipped
primo commit
2026-07-12 03:11:09 +02:00

27 lines
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 prenotazioni;
-- ------------------------------------------------------------
-- Tabella utenti (API: GET/POST/PUT/DELETE /utenti)
-- ------------------------------------------------------------
CREATE TABLE IF NOT EXISTS utenti (
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)',
Admin BOOLEAN NOT NULL DEFAULT FALSE,
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;