20190904222339_create_markers.rb 433 B

1234567891011121314
  1. class CreateMarkers < ActiveRecord::Migration[5.2]
  2. def change
  3. create_table :markers do |t|
  4. t.references :user, foreign_key: { on_delete: :cascade, index: false }
  5. t.string :timeline, default: '', null: false
  6. t.bigint :last_read_id, default: 0, null: false
  7. t.integer :lock_version, default: 0, null: false
  8. t.timestamps
  9. end
  10. add_index :markers, [:user_id, :timeline], unique: true
  11. end
  12. end