I use PostgreSQL and Migrations and never used to have any problems. Now, I cannot create a migration without the migration puking because of a faulty definition.
class CreateFoobars < ActiveRecord::Migration
class Foobar < ActiveRecord::Base; end
def self.up
create_table :foobar do |t|
t.column :name, :string, :null => false
end
end
def self.down
drop_table :foobar
end
end
When I run rake it pukes with this explanation:
rake aborted!
PGError: ERROR: multiple default values specified for column "id" of table "foobar"
: CREATE TABLE foobar ("id" serial primary key DEFAULT NULL, "name" character varying(255) NOT NULL)
so.. trying to create a serial column with DEFAULT NULL is obviously a problem, but it never used to be. I can only speculate that at some point I did a GEM update or something and grabbed some new RAILS code that breaks PostgreSQL support? Not sure...but the only workaround seems to be defining an id column of NOT NULL... something that works but should not be necessary. Any tips on this most appreciated.
Thanks