Skip to content

Instantly share code, notes, and snippets.

@jmhodges
Created January 20, 2009 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmhodges/49701 to your computer and use it in GitHub Desktop.
Save jmhodges/49701 to your computer and use it in GitHub Desktop.
class AddTimestampsToFoosAndBarsMigration < Sequel::Migration
def up
time_type = defined?(Sequel::Postgres) ? :timetz : :datetime
[:foos, :bars].each do |tab|
add_column tab, :created_at, time_type
add_column tab, :updated_at, time_type
end
end
def down
....
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment