ALTER TABLE jobs
    ALTER COLUMN tenant_id DROP NOT NULL;

ALTER TABLE jobs
    DROP CONSTRAINT jobs_tenant_id_fkey;

ALTER TABLE jobs
    ADD CONSTRAINT jobs_tenant_id_fkey
    FOREIGN KEY (tenant_id)
    REFERENCES tenants(id)
    ON DELETE SET NULL;

ALTER TABLE jobs
    ADD COLUMN result JSONB;
