CREATE TABLE IF NOT EXISTS records_awards ( id BIGSERIAL PRIMARY KEY NOT NULL, user_id BIGINT NOT NULL, award_id BIGINT NOT NULL, author_id BIGINT NOT NULL, created_at BIGINT NOT NULL, CONSTRAINT fk_user FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE, CONSTRAINT fk_author FOREIGN KEY(author_id) REFERENCES users(id) ON DELETE SET NULL, CONSTRAINT fk_award FOREIGN KEY (award_id) REFERENCES awards(id) ON DELETE CASCADE );