daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Jul 12th, 2018 61 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. class Category
  2.   include DataMapper::Resource
  3.  
  4.   property :id,          Serial
  5.   property :name,        String
  6.  
  7.   has n, :categories, :through => Resource, :constraint => :destroy!
  8.  
  9. end
  10.  
  11. class Category
  12.   include DataMapper::Resource
  13.  
  14.   property :id,          Serial
  15.   property :name,        String
  16.  
  17.   has n, :comments, :through => Resource, :constraint => :destroy!
  18.  
  19. end
  20.  
  21. # On MySQL
  22. rake db:automigrate # First run works fine
  23. rake db:automigrate # Run it again and it blows up with "Cannot delete or update a parent row: a foreign key constraint fails (code: 1217, sql state: 23000, query: DROP TABLE IF EXISTS "categories")"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top