Merge pull request #2209 from Pistos/postgresql-set-photos-id-seq

Set photos_id_seq properly for PostgreSQL
This commit is contained in:
Daniel Grippi 2011-10-24 10:11:03 -07:00
commit edd4352e49

View file

@ -0,0 +1,11 @@
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