0000_groovy_manta.sql 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. CREATE TABLE `accounts` (
  2. `id` text PRIMARY KEY NOT NULL,
  3. `account_id` text NOT NULL,
  4. `provider_id` text NOT NULL,
  5. `user_id` text NOT NULL,
  6. `access_token` text,
  7. `refresh_token` text,
  8. `id_token` text,
  9. `access_token_expires_at` integer,
  10. `refresh_token_expires_at` integer,
  11. `scope` text,
  12. `password` text,
  13. `created_at` integer NOT NULL,
  14. `updated_at` integer NOT NULL,
  15. FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
  16. );
  17. --> statement-breakpoint
  18. CREATE TABLE `sessions` (
  19. `id` text PRIMARY KEY NOT NULL,
  20. `expires_at` integer NOT NULL,
  21. `token` text NOT NULL,
  22. `created_at` integer NOT NULL,
  23. `updated_at` integer NOT NULL,
  24. `ip_address` text,
  25. `user_agent` text,
  26. `user_id` text NOT NULL,
  27. `timezone` text,
  28. `city` text,
  29. `country` text,
  30. `region` text,
  31. `region_code` text,
  32. `colo` text,
  33. `latitude` text,
  34. `longitude` text,
  35. FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
  36. );
  37. --> statement-breakpoint
  38. CREATE UNIQUE INDEX `sessions_token_unique` ON `sessions` (`token`);--> statement-breakpoint
  39. CREATE TABLE `users` (
  40. `id` text PRIMARY KEY NOT NULL,
  41. `name` text NOT NULL,
  42. `email` text NOT NULL,
  43. `email_verified` integer NOT NULL,
  44. `image` text,
  45. `created_at` integer NOT NULL,
  46. `updated_at` integer NOT NULL,
  47. `is_anonymous` integer
  48. );
  49. --> statement-breakpoint
  50. CREATE UNIQUE INDEX `users_email_unique` ON `users` (`email`);--> statement-breakpoint
  51. CREATE TABLE `verifications` (
  52. `id` text PRIMARY KEY NOT NULL,
  53. `identifier` text NOT NULL,
  54. `value` text NOT NULL,
  55. `expires_at` integer NOT NULL,
  56. `created_at` integer,
  57. `updated_at` integer
  58. );