The code powering m.abunchtell.com https://m.abunchtell.com
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

18 wiersze
489 B

  1. class CreateBookmarks < ActiveRecord::Migration[5.1]
  2. def change
  3. create_table :bookmarks do |t|
  4. t.references :account, null: false
  5. t.references :status, null: false
  6. t.timestamps
  7. end
  8. safety_assured do
  9. add_foreign_key :bookmarks, :accounts, column: :account_id, on_delete: :cascade
  10. add_foreign_key :bookmarks, :statuses, column: :status_id, on_delete: :cascade
  11. end
  12. add_index :bookmarks, [:account_id, :status_id], unique: true
  13. end
  14. end