Files
caddy-proxy-manager/drizzle/0013_issued_client_certificates.sql
fuomag9 08e24b88d2 fix migration 0013 missing statement-breakpoint markers
Drizzle's better-sqlite3 migrator splits SQL files on --> statement-breakpoint
before running each statement. Without it, multi-statement files fail with
"The supplied SQL string contains more than one statement".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 15:52:00 +01:00

19 lines
793 B
SQL

CREATE TABLE `issued_client_certificates` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`ca_certificate_id` integer NOT NULL REFERENCES `ca_certificates`(`id`) ON DELETE cascade,
`common_name` text NOT NULL,
`serial_number` text NOT NULL,
`fingerprint_sha256` text NOT NULL,
`certificate_pem` text NOT NULL,
`valid_from` text NOT NULL,
`valid_to` text NOT NULL,
`revoked_at` text,
`created_by` integer REFERENCES `users`(`id`) ON DELETE set null,
`created_at` text NOT NULL,
`updated_at` text NOT NULL
);
--> statement-breakpoint
CREATE INDEX `issued_client_certificates_ca_idx` ON `issued_client_certificates` (`ca_certificate_id`);
--> statement-breakpoint
CREATE INDEX `issued_client_certificates_revoked_at_idx` ON `issued_client_certificates` (`revoked_at`);