search for: reset_pk_sequence

Displaying 3 results from an estimated 3 matches for "reset_pk_sequence".

2006 Jun 15
8
postgresql sequence and migrations
I have a specific need to ''fixate'' my ''roles'' table sequence when migrating. at migration #4, I have 28 records in my roles tables and I can manually reset the roles_id_seq but it stands to reason that since I am doing everything else in the migration, I might as well reset the sequence there too. so I tried this in my migration file... execute
2006 Jan 25
3
Resetting sequences in unit tests with pg
Hi all, Rails 1.0 Postgresql 8.1 Ruby 1.8.4 Is there a way to reset sequences in unit tests when loading fixture data? I came across mention of a "Fixtures.reset_sequences method here: http://api.rubyonrails.com/files/vendor/rails/activerecord/CHANGELOG.html However, when I tried to call Fixtures.reset_sequences in the setup method, I got a NoMethodError. Any ideas? Thanks, Dan
2006 Apr 30
16
postgresql duplicate key violates unique constraint
I have a weird problem with creating a new record when using PostgreSQL. From inside script/console ... >> entity = Entity.new >> entity.first_name = "Foo" >> entity.last_name = "bar" >> entity.save Throws an exception due to the following SQL error: duplicate key violates unique constraint. The application was working fine before and suddenly