Files
yhy-mager/backend/migrations/000007_local_releases.up.sql
xiewenjun 54c318c615
Some checks failed
Check / delivery-static (push) Has been cancelled
Check / api (push) Has been cancelled
Check / web (push) Has been cancelled
feat: implement license platform business flows and delivery tooling
Add admin and customer interfaces, orders, signed activation and leases, protected package delivery, keyring verification, migrations, security controls, tests and deployment documentation.

Co-Authored-By: Craft Agent <agents-noreply@craft.do>
2026-10-09 15:33:22 +08:00

16 lines
795 B
SQL

CREATE TABLE product_releases (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
product_id BIGINT UNSIGNED NOT NULL,
version VARCHAR(64) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
storage_key CHAR(68) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
sha256 CHAR(64) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
size_bytes BIGINT UNSIGNED NOT NULL,
published BOOLEAN NOT NULL DEFAULT TRUE,
created_by BIGINT UNSIGNED NOT NULL,
created_at TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
PRIMARY KEY(id),
UNIQUE KEY uq_releases_version(product_id,version),
CONSTRAINT fk_release_product FOREIGN KEY(product_id) REFERENCES products(id),
CONSTRAINT fk_release_admin FOREIGN KEY(created_by) REFERENCES admins(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;