railsなしでrailsのdb:migrateを使う方法はどうやるんだろう?
あとで、調べる。
あっなんだこれだけか。この手軽さがたまらないね。javaではありえん手軽さ。
rakeでやる方法がまだわかってないけど。
require 'rubygems' require 'activerecord' class Testdayo < ActiveRecord::Migration def self.up create_table :testdayo do |t| t.column :create_pgm, :string t.column :created_on, :datetime, :null => false t.column :update_pgm, :string t.column :updated_on, :datetime, :null => false t.column :deleted_at, :datetime end end def self.down drop_table :testdayo end end ActiveRecord::Base.establish_connection( :adapter => 'mysql', :host => 'localhost', :username => 'user', :password => 'pass', :database => 'db' ) Testdayo.up Testdayo.down