CREATE TABLE identification_apis (
                     id          BIGINT PRIMARY KEY IDENTITY (1, 1),
                     project_id  BIGINT         NOT NULL REFERENCES projects (id),
                     name        NVARCHAR(64)   NOT NULL,
                    enabled BIT NOT NULL,
                     deleted     BIT            NOT NULL,
                      url NVARCHAR(512) NOT NULL,
                      created_at  datetimeoffset NOT NULL,
                      updated_at  datetimeoffset NOT NULL,
                      deleted_at  datetimeoffset,
                      restored_at datetimeoffset
);

CREATE UNIQUE INDEX identification_apis_project_enabled_uniq
    ON identification_apis (project_id)
    WHERE enabled = 1;
CREATE INDEX identification_apis_project_ix
    ON identification_apis (project_id);
