-- +migrate Up
CREATE TABLE "PostReference"
(
    post_id        TEXT REFERENCES "Post" (id),
    source_id      TEXT REFERENCES "Source" (id),
    url            TEXT NOT NULL UNIQUE,
    source_post_id TEXT,
    PRIMARY KEY (post_id, source_id)
);

-- +migrate Down
DROP TABLE "PostReference";