Skip to content

Commit

Permalink
Store Item public_id as int rather than string
Browse files Browse the repository at this point in the history
  • Loading branch information
mistydemeo committed Aug 14, 2012
1 parent dd390b9 commit f917c21
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions db/migrate/20120814211443_public_i_d_as_int.rb
@@ -0,0 +1,19 @@
class PublicIDAsInt < ActiveRecord::Migration
def up
execute <<-EOSQL
ALTER TABLE items
ALTER COLUMN public_id
TYPE int
USING public_id::int
EOSQL
end

def down
execute <<-EOSQL
ALTER TABLE items
ALTER COLUMN public_id
TYPE text
USING public_id::char
EOSQL
end
end

0 comments on commit f917c21

Please sign in to comment.