You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CineBase utilizza MariaDB 10.11 come database relazionale. L'accesso ai dati è mediato da Entity Framework Core con il provider Pomelo.EntityFrameworkCore.MySql. Il database contiene 27 tabelle organizzate in domini funzionali.
Connessione
La stringa di connessione è costruita dinamicamente da variabili d'ambiente:
Il server version può essere auto-rilevato (DB_USE_AUTODETECT=true) o specificato esplicitamente (DB_SERVER_VERSION=10.11.0-mariadb). In ambiente Docker si usa il valore esplicito per evitare latenza di auto-detection.
SalaPosto: unique su (SalaId, Settore, Fila, Numero)
Ordine: unique su CodiceOrdine, IdempotencyKey
Biglietto: unique su (ShowId, SalaPostoId), CodiceBiglietto
ShowPostoStato: unique su (ShowId, SalaPostoId), indici su HoldToken, ScadeAtUtc
RefreshToken: composite su (UserId, DeviceId)
ExternalAuthState: unique su StateHash
ExternalAuthExchangeCode: unique su CodeHash
Relazioni principali
Regista ──1:N──► Film ──1:N──► FilmCategoria ◄──N:1── Categoria
Film ──1:N──► Show ◄──N:1── Cinema
Cinema ──1:N──► Sala ──1:N──► SalaPosto
Show ──1:N──► ShowPostoStato ◄──N:1── SalaPosto
Show ──1:N──► ShowSeatPrice
Show ──1:N──► Ordine ──1:N──► Biglietto
User ──1:N──► Ordine
User ──1:N──► Biglietto
User ──1:N──► RefreshToken
User ──1:N──► UserExternalLogin
User ──1:N──► MovimentoCredito
Show ──1:0,1──► ShowCancellation ──1:N──► OrdineRefund
Migrazioni EF Core
Il progetto contiene 18 migrazioni in backend/FilmAPI/Migrations/. La migrazione iniziale InitialCreate risale al 2026-03-12. Le migrazioni più recenti includono:
AddShowPublicationFields (2026-06-02): campi IsPublished/PublishAtUtc per show
AddShowPurchaseLockMinutes (2026-06-02): blocco acquisto show passati
AddFilmStatusAndTmdbId (2026-05-23): stato film (InArrivo/InCartellone/FuoriCatalogo) e TMDB ID
AddSeatCategoryAndShowSeatPrices (2026-05-20): prezzi per categoria posto
AddShowCancellationAndRefunds (2026-05-10): annullamento show e rimborsi
Il database viene migrato automaticamente all'avvio dell'applicazione tramite DatabaseBootstrap.BootstrapAsync().