fluent migrator chris farrell quick solutions. what is it? sean chambers, nate kohari, justin...

7
Fluent Migrator Chris Farrell Quick Solutions

Upload: chloe-floyd

Post on 16-Dec-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Fluent Migrator Chris Farrell Quick Solutions. What is it? Sean Chambers, Nate Kohari, Justin Etheredge.Net Schema Migration Tool Fluent Interface Write.Schema.Transformations.With.Net

Fluent Migrator

Chris FarrellQuick Solutions

Page 2: Fluent Migrator Chris Farrell Quick Solutions. What is it? Sean Chambers, Nate Kohari, Justin Etheredge.Net Schema Migration Tool Fluent Interface Write.Schema.Transformations.With.Net

What is it?

• Sean Chambers, Nate Kohari, Justin Etheredge• .Net Schema Migration Tool• Fluent Interface • Write.Schema.Transformations.With.Net• Supports: – SQL Server, MySQL, PostGres, Oracle, Sqlite,Jet

Page 3: Fluent Migrator Chris Farrell Quick Solutions. What is it? Sean Chambers, Nate Kohari, Justin Etheredge.Net Schema Migration Tool Fluent Interface Write.Schema.Transformations.With.Net

Why

• Devs sharing the same DB == Headaches• Product Updates from n-th Version to Current• Apply Dev updates to Production• Testing Legacy Versions• Create Testing Databases• Multi-Targeted(create SQL Lite, SQL, Etc)

Page 4: Fluent Migrator Chris Farrell Quick Solutions. What is it? Sean Chambers, Nate Kohari, Justin Etheredge.Net Schema Migration Tool Fluent Interface Write.Schema.Transformations.With.Net

What Can FM do?

• Update any ? Version to current version• Create an update SQL Script• Create a specific version of the database• Rollback migration(s)• Execute SQL Scripts

Page 5: Fluent Migrator Chris Farrell Quick Solutions. What is it? Sean Chambers, Nate Kohari, Justin Etheredge.Net Schema Migration Tool Fluent Interface Write.Schema.Transformations.With.Net

Syntax

• libs\FluentMigrator\Migrate --verbose=true --db=sqlserver2008 -c="Data Source=localhost;Initial Catalog=Fanug;Integrated Security=SSPI" --timeout=1500 -a="src\FluentMigratorDemo\bin\Debug\FluentMigratorDemo.dll" %1 %2 %3 %4

• Export: -output -outputFilename="test.sql“• Migrate Up: -t=migrate:up• Rollback: -t=rollback %1• Rollback All: -t=rollback:all• Rollback to Nth Version: -t=rollback:toversion --version=%1

Page 6: Fluent Migrator Chris Farrell Quick Solutions. What is it? Sean Chambers, Nate Kohari, Justin Etheredge.Net Schema Migration Tool Fluent Interface Write.Schema.Transformations.With.Net

Links

• Official Repo– https://github.com/schambers/fluentmigrator– .Net 3.5, 32 bit SQLite

• My Repo– https://github.com/chrispfarrell/fluentmigrator

• Jeffs Repo– https://github.com/walkercoderanger

Page 7: Fluent Migrator Chris Farrell Quick Solutions. What is it? Sean Chambers, Nate Kohari, Justin Etheredge.Net Schema Migration Tool Fluent Interface Write.Schema.Transformations.With.Net

DEMO

• Create Table• Alter Table• Execute SQL command• Execute SQL Script• Export SQL script• Create New DB• Create Specific Version