diaspora/db/migrate/20111019013244_postgresql_photos_id_seq_init.rb

11 lines
273 B
Ruby

class PostgresqlPhotosIdSeqInit < ActiveRecord::Migration
def self.up
if postgres?
execute "SELECT setval('photos_id_seq', COALESCE( ( SELECT MAX(id)+1 FROM photos ), 1 ) )"
end
end
def self.down
# No reason or need to migrate this down.
end
end