/ resources / migrations / 20190109005337-add-relation-table.up.sql
20190109005337-add-relation-table.up.sql
1  CREATE TABLE relations
2  (id INT NOT NULL AUTO_INCREMENT,
3   from_id INT NOT NULL,
4   to_id INT NOT NULL,
5  
6   PRIMARY KEY(id),
7   FOREIGN KEY (from_id) REFERENCES users(id),
8   FOREIGN KEY (to_id) REFERENCES users(id));