cat/resources/migrations/20190109005337-add-relation-table.up.sql

8 lines
207 B
MySQL
Raw Permalink Normal View History

2019-01-11 23:10:58 +01:00
CREATE TABLE relations
(id INT NOT NULL AUTO_INCREMENT,
from_id INT NOT NULL,
to_id INT NOT NULL,
PRIMARY KEY(id),
FOREIGN KEY (from_id) REFERENCES users(id),
FOREIGN KEY (to_id) REFERENCES users(id));