CREATE TABLE identification_apis (
                      id          BIGINT PRIMARY KEY,
                      project_id  BIGINT      NOT NULL REFERENCES projects (id),
                      name        VARCHAR(64) NOT NULL,
                      enabled     boolean not null,
                      deleted     BOOLEAN     NOT NULL,
                      url varchar(512) not null,
                      created_at  TIMESTAMPTZ NOT NULL,
                      updated_at  TIMESTAMPTZ NOT NULL,
                      deleted_at  TIMESTAMPTZ,
                      restored_at TIMESTAMPTZ
);

CREATE SEQUENCE identification_apis_id_seq;
CREATE UNIQUE INDEX identification_apis_project_enabled_uniq
    ON identification_apis (project_id)
    WHERE enabled = TRUE;
CREATE INDEX identification_apis_project_ix
    ON identification_apis (project_id);
