19. Migration based
v1 v2
Non rileva conflitti
L’ordine è cruciale
State based
v1 v2
Non riconosce i rename
Azzera eventuali
differenze
I due paradigmi
21. Are the two mutually exclusive?
No
Dev can use a Schema diff tool like SSDT to generate
migration scripts
Migration script can be augmented stating the baseline
version
State-based tools have pre- and post-deploy phases for data
migration
We can add dependency check between migration scripts
To warn about scripts interaction and dependency
MS T-SQL syntax parser available for .Net
28. Unit testing
tSQLt
Open source database Unit Testing
framework for SQL Server
https://tsqlt.org/
DbUnit
JUnit extension
http://www.dbunit.org/
NDbUnit2
.NET library for managing database state
during unit testing
https://github.com/savornicesei/NDbUnit
2
DbFit
Fitness style (Java+Jdbc)
http://dbfit.github.io/dbfit/
Respawn
Intelligent database cleaner for
integration tests
https://github.com/jbogard/Respawn
31. Elementi Chiave
In input solo sorgenti
Pacchetti (es. dacpac) vanno in un Artifact Store
e devono essere il risultato di una build
Istanze di database per la build
Ad ogni Branch la sua Istanza
Gestione delle credenziali
33. Database Refactoring Cycle
Initial state Final state
Implement the refactoring
Test on non-production
Refactoring completed
deploy new schema,
migrate data
deploy new application version
34. Database Refactoring Cycle
Initial state Final state
Implement the refactoring
Test on non-production
Refactoring completed
deploy new schema,
migrate data
deploy new application version
35. Database Refactoring Cycle
Initial state Final state
Transitional state
Implement the refactoring
Test on non-production
Refactoring completed
All systems use the new schema
Coexistence of
old and new schema
Expand:
deploy new schema,
migrate data,
add scaffolding code
Contract:
Drop old schema objects
and scaffolding code
Giovanni Francesco Barbieri detto il Guercino (1591-1666)Atlante che sostiene il globo celeste, 1646Firenze, Museo Mozzi Bardini, inv. MCF-MB 1922-1148.a
Il mito del titano Atlante condannato da Zeus a sorreggere la volta celeste per l’eternità ebbe notevole fortuna iconografica nel corso del Seicento. Tra le opere più famose è questa versione, dipinta per Lorenzo de’ Medici.