Skip to content

Instantly share code, notes, and snippets.

@lukeredpath
Created August 18, 2009 12:16
Show Gist options
  • Save lukeredpath/169695 to your computer and use it in GitHub Desktop.
Save lukeredpath/169695 to your computer and use it in GitHub Desktop.
require "active_record"
ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
:dbfile => "test.sqlite3"
)
ActiveRecord::Schema.define do
create_table "things" do |t|
t.column "flag", :bool
end
remove_column "things", "flag"
end
system "echo '.schema things' | sqlite3 test.sqlite3"
# -- create_table("things")
# -> 0.0702s
# -- remove_column("things", "name")
# -> 0.0106s
# CREATE TABLE "things" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment