Add backend support for bookmarks

Bookmarks behave like favourites, except they aren't shared with other
users and do not have an associated counter.
This commit is contained in:
Thibaut Girka
2018-04-10 22:13:15 +02:00
parent 33c2bbdda7
commit 50eb8f1f61
11 changed files with 188 additions and 1 deletions

View File

@ -0,0 +1,14 @@
class CreateBookmarks < ActiveRecord::Migration[5.1]
def change
create_table :bookmarks do |t|
t.references :account, null: false
t.references :status, null: false
t.timestamps
end
add_foreign_key :bookmarks, :accounts, column: :account_id, on_delete: :cascade
add_foreign_key :bookmarks, :statuses, column: :status_id, on_delete: :cascade
add_index :bookmarks, [:account_id, :status_id], unique: true
end
end