Trilhos: viola a restrição de chave estrangeira

Eu tenho três modelos:Book, genre, BookGenree aqui estão os relacionamentos:

class BookGenre < ActiveRecord::Base
  belongs_to :book
  belongs_to :genre
end


class Book < ActiveRecord::Base
  has_many :book_genres
  has_many :genres, through: :book_genres
end


class Genre < ActiveRecord::Base
  has_many :book_genres
  has_many :books, through: :book_genres
end

E então eu usoseed arquivo para colocar dados nessas tabelas.

Mas quando eu quero fazerrake db:seed novamente, mostrou este erro

ActiveRecord::InvalidForeignKey: PG::ForeignKeyViolation: ERROR:  update or delete on table "books" violates foreign key constraint "fk_rails_4a117802d7" on table "book_genres"
DETAIL:  Key (id)=(10) is still referenced from table "book_genres".

No meuseed.rb

Book.destroy_all
Genre.destroy_all
...create data 

questionAnswers(2)

yourAnswerToTheQuestion