20160424000002_create_external_sync.rb 745 B

123456789101112131415
  1. class CreateExternalSync < ActiveRecord::Migration
  2. def up
  3. create_table :external_syncs do |t|
  4. t.string :source, limit: 100, null: false
  5. t.string :source_id, limit: 200, null: false
  6. t.string :object, limit: 100, null: false
  7. t.integer :o_id, null: false
  8. t.text :last_payload, limit: 500.kilobytes + 1, null: true
  9. t.timestamps null: false
  10. end
  11. add_index :external_syncs, [:source, :source_id], unique: true
  12. add_index :external_syncs, [:source, :source_id, :object, :o_id], name: 'index_external_syncs_on_source_and_source_id_and_object_o_id'
  13. add_index :external_syncs, [:object, :o_id]
  14. end
  15. end