Files
yhy-mager/backend/migrations/000003_license_operations.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

15 lines
753 B
SQL

CREATE TABLE license_operations (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
license_id BIGINT UNSIGNED NOT NULL,
actor_admin_id BIGINT UNSIGNED NOT NULL,
operation VARCHAR(32) NOT NULL,
idempotency_key VARCHAR(128) NOT NULL,
request_fingerprint BINARY(32) NOT NULL,
created_at TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
PRIMARY KEY (id),
UNIQUE KEY uq_license_operation_key (actor_admin_id, operation, idempotency_key),
KEY idx_license_operations_license (license_id),
CONSTRAINT fk_license_operations_license FOREIGN KEY (license_id) REFERENCES licenses(id),
CONSTRAINT fk_license_operations_admin FOREIGN KEY (actor_admin_id) REFERENCES admins(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;