Sriharsha Chintalapani 18bd4689a0
Add Data Contracts Specification and APIs (#21164)
* Add Data Contracts Specification and APIs

* Fix checkstyle

* Add @Repository

* Add @Repository

* Address YAML APIs

* Fix tests

* Fix tests

* Address comments

* Fix tests for checking table/topic fields do exists for a data contract

* migrate to jakarta

* migrate to jakarta

* add semantics

---------

Co-authored-by: Harsha <harsha@Harshas-MacBook-Air.local>
Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com>
2025-06-04 06:36:28 +02:00

24 lines
849 B
SQL

ALTER TABLE background_jobs
ADD COLUMN runAt BIGINT;
CREATE INDEX background_jobs_run_at_index ON background_jobs(runAt);
CREATE TABLE IF NOT EXISTS data_contract_entity (
id VARCHAR(36) GENERATED ALWAYS AS (json ->> '$.id') STORED NOT NULL,
name VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.name') NOT NULL,
fqnHash VARCHAR(768) NOT NULL,
json JSON NOT NULL,
updatedAt BIGINT UNSIGNED GENERATED ALWAYS AS (json ->> '$.updatedAt') NOT NULL,
updatedBy VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.updatedBy') NOT NULL,
deleted BOOLEAN GENERATED ALWAYS AS (json -> '$.deleted') NOT NULL,
PRIMARY KEY (id),
UNIQUE (fqnHash),
INDEX (name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- Add index for deleted flag
ALTER TABLE data_contract_entity ADD INDEX index_data_contract_entity_deleted(deleted);