CREATE TABLE "person" ( "id" int, "email" varchar(255), "phone_number" varchar(255), "" varchar(255), "" datetime ); CREATE TABLE "conversation" ( "id" int, "person_id" int CONSTRAINT person_id REFERENCES person(id), "" datetime, "status" varchar(255), "fingerprint" varchar(255) ); CREATE TABLE "message" ( "id" int, "conversation_id" int CONSTRAINT conversation_id REFERENCES conversation(id), "body" varchar(255), "person_id" int CONSTRAINT person_id REFERENCES person(id), "status" varchar(255) ); CREATE TABLE "recipient" ( "person_id" int CONSTRAINT person_id REFERENCES person(id), "conversation_id" int CONSTRAINT conversation_id REFERENCES conversation(id), "status" varchar(255), "contact_id" int CONSTRAINT contact_id REFERENCES contact(id), "id" int ); CREATE TABLE "contact" ( "id" int, "owner_id" int CONSTRAINT person_id REFERENCES person(id), "phone_number" varchar(255), "target_user_id (opt)" int CONSTRAINT person_id REFERENCES person(id) );