esameits24-26backend/initdb/01_schema.sql
AV77web 69ee74a1b9
All checks were successful
Deploy to VPS / build (push) Successful in 16s
Deploy to VPS / deploy (push) Successful in 19s
correzione ai file di initdb
2026-07-12 04:09:54 +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 `esameits24-26`;
-- ------------------------------------------------------------
-- 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;