@authhero/drizzle 0.57.0 → 0.58.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ CREATE TABLE `grants` (
2
+ `id` text(21) PRIMARY KEY NOT NULL,
3
+ `tenant_id` text(255) NOT NULL,
4
+ `user_id` text(255) NOT NULL,
5
+ `client_id` text(100) NOT NULL,
6
+ `audience` text(100) DEFAULT '' NOT NULL,
7
+ `scope` text DEFAULT '[]' NOT NULL,
8
+ `created_at` text(35) NOT NULL,
9
+ `updated_at` text(35) NOT NULL,
10
+ FOREIGN KEY (`tenant_id`) REFERENCES `tenants`(`id`) ON UPDATE no action ON DELETE cascade,
11
+ FOREIGN KEY (`user_id`,`tenant_id`) REFERENCES `users`(`user_id`,`tenant_id`) ON UPDATE no action ON DELETE cascade
12
+ );
13
+ --> statement-breakpoint
14
+ CREATE UNIQUE INDEX `grants_natural_key_idx` ON `grants` (`tenant_id`,`user_id`,`client_id`,`audience`);--> statement-breakpoint
15
+ CREATE INDEX `grants_tenant_user_idx` ON `grants` (`tenant_id`,`user_id`);