liam said about 1 year ago on Friend Requests From Scratch :
I'm having trouble with being able to create a friendship (which I've named a 'connection') in the rails console, so that users can be friends (which I've named 'contacts'):

2.7.0 :033 > user4.contact_request(user5)
  Connection Exists? (0.3ms)  SELECT 1 AS one FROM "connections" WHERE "connections"."user_id" = ? AND "connections"."contact_id" = ? LIMIT ?  [["user_id", 7], ["contact_id", 8], ["LIMIT", 1]]
  TRANSACTION (0.1ms)  begin transaction
  Connection Create (1.1ms)  INSERT INTO "connections" ("user_id", "contact_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)  [["user_id", 7], ["contact_id", 8], ["created_at", "2021-04-19 23:45:32.553041"], ["updated_at", "2021-04-19 23:45:32.553041"]]
  TRANSACTION (0.1ms)  rollback transaction
Traceback (most recent call last):
        4: from (irb):32
        3: from (irb):33:in `rescue in irb_binding'
        2: from app/models/user.rb:49:in `contact_request'
        1: from app/models/user.rb:50:in `block in contact_request'
ActiveRecord::StatementInvalid (SQLite3::SQLException: no such table: main.contacts)

I'm not sure what to do here!