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

Set photos_id_seq properly for PostgreSQL (re: recent "MovePhotosToTheirOwnTable" migration, which neglected to do this).
Set photos_id_seq properly for PostgreSQL (re: recent "MovePhotosToTheirOwnTable" migration, which neglected to do this).
