Download - Database under source control
![Page 1: Database under source control](https://reader036.vdocument.in/reader036/viewer/2022081605/58781c551a28aba12d8b5aa7/html5/thumbnails/1.jpg)
Database & Source Control 9
giugno 2016
Sponsored by
Anche con SQL Server si può
![Page 2: Database under source control](https://reader036.vdocument.in/reader036/viewer/2022081605/58781c551a28aba12d8b5aa7/html5/thumbnails/2.jpg)
Sponsor
![Page 3: Database under source control](https://reader036.vdocument.in/reader036/viewer/2022081605/58781c551a28aba12d8b5aa7/html5/thumbnails/3.jpg)
Presenting...
http://www.devopsheroes.net/
![Page 4: Database under source control](https://reader036.vdocument.in/reader036/viewer/2022081605/58781c551a28aba12d8b5aa7/html5/thumbnails/4.jpg)
Alessandro Alpi
Microsoft MVP – SQL Server dal 2008Blog ITA: http://blogs.dotnethell.it/suxstellinoBlog ENG: http://suxstellino.wordpress.com/Website: http://www.alessandroalpi.net
CTO Engage IT Services S.r.l.www.engageitservices.itTeam leader (SCRUM)
CommunitiesGetlatestversion.it
![Page 5: Database under source control](https://reader036.vdocument.in/reader036/viewer/2022081605/58781c551a28aba12d8b5aa7/html5/thumbnails/5.jpg)
Cos’è
Repository perGestore dei cosiddetti changes (revisioni dei nostri file)Storage sicuroGestire il lavoro (anche e soprattutto) in team
Sinonimo di Version ControlParte di un Software Configuration Management
Cosa non è? Uno storage per tutto
1/7DB SC
![Page 6: Database under source control](https://reader036.vdocument.in/reader036/viewer/2022081605/58781c551a28aba12d8b5aa7/html5/thumbnails/6.jpg)
Perché si usa
Elemento base per i processi a pattern «continuous»Continuous Integration (integrazione continua dei cambiamenti in sviluppo)Continuous Delivery (evoluzione della precedente, «finisce» con UAT e un rilascio)Continuous Deployment (sinonimi, delivery ~ deploy, per alcune scuole)
RevisioniCollaborazione e condivisioneRestore delle versioni e backup
Per cosa non si usa? I film scaricati
2/7DB SC
![Page 7: Database under source control](https://reader036.vdocument.in/reader036/viewer/2022081605/58781c551a28aba12d8b5aa7/html5/thumbnails/7.jpg)
Ok, e su database?
Condivisione del database nel teamSincronizzazione dei databaseInvio dei changeset a databaseRevisioni del codice
Di programmabilitàDi Data Definition Language (schema)Di Data Control Language (security)Di dati statici
I dati utente? Non sono da source control!
3/7DB SC
![Page 8: Database under source control](https://reader036.vdocument.in/reader036/viewer/2022081605/58781c551a28aba12d8b5aa7/html5/thumbnails/8.jpg)
Com’è fatto
RepositoryModalità centralizzata (uno solo «a server»)Modalità distribuito (più copie del repository)
APIComandi per copiare il repository (distribuito)Comandi per scaricare il repositoryComandi per inviare i changeset
ModalitàCondivisa (centralizzata, un solo database)Dedicata (distribuita, più database)
E le branch? Sessione di Igor!
4/7DB SC
Dedicata Condivisa
![Page 9: Database under source control](https://reader036.vdocument.in/reader036/viewer/2022081605/58781c551a28aba12d8b5aa7/html5/thumbnails/9.jpg)
Cosa c’è dietro le quinte
Working base folderCopia locale del database scaricato Copia locale dei cambiamenti
Transient folderUltima versione effettiva su source control
ComparazioneLa Working base è sincronizzata con le revisioniLa Working base viene comparata con la transient per generare le diff
SSMS come vede i cambiamenti? Polling di una dll
5/7DB SC
![Page 10: Database under source control](https://reader036.vdocument.in/reader036/viewer/2022081605/58781c551a28aba12d8b5aa7/html5/thumbnails/10.jpg)
La linea del tempo.. 5/7DB SC
Sql Server Management Studio
IDEWorking folder
File “.sql”
Development
Team Explorer toSource Control
Code, History andChangesets
Save Send
GetApply
Repository
LINK
![Page 11: Database under source control](https://reader036.vdocument.in/reader036/viewer/2022081605/58781c551a28aba12d8b5aa7/html5/thumbnails/11.jpg)
Ci sono strumenti..
IDE di gestioneRedGate SQL Source Control (attualmente v5 in RC)ApexSQL Source Control
Integrati a Sql Server Management Studio
Sono IDE che usano API per accedere a SC
7/7DB SC
![Page 12: Database under source control](https://reader036.vdocument.in/reader036/viewer/2022081605/58781c551a28aba12d8b5aa7/html5/thumbnails/12.jpg)
DEMO 1 – RedGate SoC v5 con VSTS (link + get)
Modalità dedicata + working folderUtilizzo di VS Team Explorer
Link + get del database
![Page 13: Database under source control](https://reader036.vdocument.in/reader036/viewer/2022081605/58781c551a28aba12d8b5aa7/html5/thumbnails/13.jpg)
DEMO 2 – RedGate SoC v5 con VSTS (new/edit items)
Modifica oggettiAggiunta dati
![Page 14: Database under source control](https://reader036.vdocument.in/reader036/viewer/2022081605/58781c551a28aba12d8b5aa7/html5/thumbnails/14.jpg)
DEMO 3 – RedGate SoC v5 con VSTS (remove items)
Rimozione oggettiRimozione dati
![Page 15: Database under source control](https://reader036.vdocument.in/reader036/viewer/2022081605/58781c551a28aba12d8b5aa7/html5/thumbnails/15.jpg)
DEMO 4 – RedGate SoC v5 con VSTS (filtri e options)
FiltriComparison options
![Page 16: Database under source control](https://reader036.vdocument.in/reader036/viewer/2022081605/58781c551a28aba12d8b5aa7/html5/thumbnails/16.jpg)
DEMO 5 – RedGate SoC v5 con VSTS (migrations)
Migrations e refactor iniettatise ci stanno, altrimenti due chiacchiere
![Page 17: Database under source control](https://reader036.vdocument.in/reader036/viewer/2022081605/58781c551a28aba12d8b5aa7/html5/thumbnails/17.jpg)
Grazie
•Domande?