8000 GitHub - kitofr/db-migrate: A migrater that uses SqlCmd to execute changescripts etc.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A migrater that uses SqlCmd to execute changescripts etc.

Notifications You must be signed in to change notification settings

kitofr/db-migrate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Db Migrate - Db-migrations for .Net Dummies

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

Example:

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

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0