Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
1.4 kB ยท 38 lines
SQL
at incident-api
1234567891011121314151617181920212223242526272829303132333435363738CREATE TABLE `viewer` ( `id` integer PRIMARY KEY NOT NULL, `name` text, `email` text, `emailVerified` integer, `image` text, `created_at` integer DEFAULT (strftime('%s', 'now')), `updated_at` integer DEFAULT (strftime('%s', 'now')));--> statement-breakpointCREATE UNIQUE INDEX `viewer_email_unique` ON `viewer` (`email`);--> statement-breakpointCREATE TABLE `viewer_accounts` ( `user_id` text NOT NULL, `type` text NOT NULL, `provider` text NOT NULL, `providerAccountId` text NOT NULL, `refresh_token` text, `access_token` text, `expires_at` integer, `token_type` text, `scope` text, `id_token` text, `session_state` text, PRIMARY KEY(`provider`, `providerAccountId`), FOREIGN KEY (`user_id`) REFERENCES `viewer`(`id`) ON UPDATE no action ON DELETE cascade);--> statement-breakpointCREATE TABLE `viewer_session` ( `session_token` text PRIMARY KEY NOT NULL, `user_id` integer NOT NULL, `expires` integer NOT NULL, FOREIGN KEY (`user_id`) REFERENCES `viewer`(`id`) ON UPDATE no action ON DELETE cascade);--> statement-breakpointALTER TABLE `page` ADD `access_type` text DEFAULT 'public';--> statement-breakpointALTER TABLE `page` ADD `auth_email_domains` text;--> statement-breakpoint-- NOTE: manual migration to set the access type based on the password columnUPDATE `page` SET `access_type` = 'password' WHERE `password` IS NOT NULL AND `password` != '' AND `password_protected` = 1;