Added migration for creating Shortcuts

• Added:
- migration for creating Shortcuts
This commit is contained in:
mgabdev
2020-07-21 22:17:20 -05:00
parent df7fdff265
commit 405ace09da
2 changed files with 24 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
class CreateShortcuts < ActiveRecord::Migration[5.2]
def change
create_table :shortcuts do |t|
t.timestamps
t.belongs_to :account, foreign_key: { on_delete: :cascade }, null: false
t.bigint :shortcut_id, null: false
t.string :shortcut_type, null: false, default: ''
end
add_index :shortcuts, [:account_id, :shortcut_id, :shortcut_type], unique: true
end
end