Home > db-migrate

db-migrate

Db-migrate is a project mainly written in Ruby, it's free.

A migrater that uses SqlCmd to execute changescripts etc.

= 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?)

Previous:old_python_tide