aboutsummaryrefslogtreecommitdiffstats
path: root/packages/db/drizzle/0056_user_invites.sql
blob: 5ea38cca7fa5f99b28153d3f494ff69ef0986d12 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
CREATE TABLE `invites` (
	`id` text PRIMARY KEY NOT NULL,
	`email` text NOT NULL,
	`token` text NOT NULL,
	`createdAt` integer NOT NULL,
	`expiresAt` integer NOT NULL,
	`usedAt` integer,
	`invitedBy` text NOT NULL,
	FOREIGN KEY (`invitedBy`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE UNIQUE INDEX `invites_token_unique` ON `invites` (`token`);