Skip to content

About

A migrater that uses SqlCmd to execute changescripts etc.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

41 Commits

Folders and files

Repository files navigation

This is an atempt to help the .Net community with some db-migrations. Instead of beeing bound to NANT-tasks such as DB-Deploy, you can now use SqlCmd to migrate your database.

  • Requires: SqlCmd.exe and a Table called ChangeLog

base_dir = File.join(File.dirname(__FILE__), "your_db_folder")
database = DatabaseMigrate::Database.new("database_instance", "catalog_name", "user", "password")
#database.debug = true => If you want some verbose output

database.drop => only drops if catalog exists
database.create
database.apply(File.join(base_dir, "SchemaScripts", "Schema.sql")) => Initial schema plz!
puts "Current revision: #{database.current_revision}" => You should now have a ChangeLog table

database.migrate(File.join(base_dir, "ChangeScripts"), 10) => Apply changescripts to number 10

puts "Current revision: #{database.current_revision}" => 10
database.migrate(File.join(base_dir, "ChangeScripts")) => Apply change scripts from 10 to the last one

puts "Current revision: #{database.current_revision}" => 42 (right?)

About

A migrater that uses SqlCmd to execute changescripts etc.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages