Initial commit: KOC LOOP platform

This commit is contained in:
巫凤萍
2026-07-30 12:06:41 +08:00
commit d2cde2c9b2
98 changed files with 44076 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
CREATE TABLE `delegation_bundles` (
`id` text PRIMARY KEY NOT NULL,
`task_id` text NOT NULL,
`claim_id` text NOT NULL,
`partner_id` text NOT NULL,
`label` text NOT NULL,
`share_token` text NOT NULL,
`quantity` integer NOT NULL,
`status` text DEFAULT 'active' NOT NULL,
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
`revoked_at` text
);
--> statement-breakpoint
CREATE UNIQUE INDEX `delegation_bundles_share_token_idx` ON `delegation_bundles` (`share_token`);--> statement-breakpoint
CREATE INDEX `delegation_bundles_claim_created_idx` ON `delegation_bundles` (`claim_id`,`created_at`);--> statement-breakpoint
ALTER TABLE `distributions` ADD `delegation_bundle_id` text;