create_table "connections", force: :cascade do |t| t.integer "user_id", null: false t.integer "contact_id", null: false t.integer "status", limit: 1, default: 0 t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false t.index ["contact_id"], name: "index_connections_on_contact_id" t.index ["user_id"], name: "index_connections_on_user_id" end
create_table "users", force: :cascade do |t| t.string "email", default: "", null: false t.string "encrypted_password", default: "", null: false t.string "reset_password_token" t.datetime "reset_password_sent_at" t.datetime "remember_created_at" t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false t.boolean "admin", default: false t.index ["email"], name: "index_users_on_email", unique: true t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true end add_foreign_key "connections", "contacts" add_foreign_key "connections", "users" end
class CreateConnections < ActiveRecord::Migration[6.1] def change create_table :connections do |t| t.references :user, null: false, foreign_key: { to_table: :users} t.references :contact, null: false, foreign_key: {to_table: :users} t.integer :status, default: 0, limit: 1 t.timestamps end end end