Skip to content

Instantly share code, notes, and snippets.

@m2web
Created January 24, 2013 09:49
Show Gist options
  • Save m2web/4619327 to your computer and use it in GitHub Desktop.
Save m2web/4619327 to your computer and use it in GitHub Desktop.
class CreateTableNameSequence < ActiveRecord::Migration
def up
#create sequence for categories table
execute <<-SQL
CREATE SEQUENCE table_name_id_seq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 25
CACHE 1;
SQL
end
def down
DROP SEQUENCE table_name_id_seq;
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment