create-m5kdev 0.40.2 → 0.41.0

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.
Files changed (52) hide show
  1. package/package.json +1 -1
  2. package/templates/minimal-app/.cursor/rules/frontend-component-guide.mdc +95 -95
  3. package/templates/minimal-app/.cursor/rules/frontend-data-guide.mdc +103 -103
  4. package/templates/minimal-app/.cursor/rules/frontend-form-guide.mdc +80 -80
  5. package/templates/minimal-app/.cursor/rules/frontend-hook-guide.mdc +79 -79
  6. package/templates/minimal-app/.cursor/rules/frontend-i18n-guide.mdc +45 -45
  7. package/templates/minimal-app/.cursor/rules/module-dto-guide.mdc +60 -60
  8. package/templates/minimal-app/.cursor/rules/module-prompt-guide.mdc +214 -214
  9. package/templates/minimal-app/.cursor/rules/module-repository-guide.mdc +167 -167
  10. package/templates/minimal-app/.cursor/rules/module-schema-guide.mdc +53 -53
  11. package/templates/minimal-app/.cursor/rules/module-service-guide.mdc +367 -367
  12. package/templates/minimal-app/.cursor/rules/module-trpc-guide.mdc +71 -71
  13. package/templates/minimal-app/apps/.gitignore.tpl +13 -13
  14. package/templates/minimal-app/apps/e2e/package.json.tpl +23 -23
  15. package/templates/minimal-app/apps/e2e/tests/standard.spec.ts.tpl +11 -22
  16. package/templates/minimal-app/apps/email/package.json.tpl +34 -34
  17. package/templates/minimal-app/apps/expo/.gitignore.tpl +44 -44
  18. package/templates/minimal-app/apps/expo/.prettierignore +13 -13
  19. package/templates/minimal-app/apps/expo/.prettierrc.json.tpl +9 -9
  20. package/templates/minimal-app/apps/expo/CHANGELOG.md.tpl +156 -156
  21. package/templates/minimal-app/apps/expo/README.md.tpl +44 -44
  22. package/templates/minimal-app/apps/expo/package.json.tpl +63 -63
  23. package/templates/minimal-app/apps/landing/package.json.tpl +34 -34
  24. package/templates/minimal-app/apps/server/drizzle/0000_whole_echo.sql +366 -366
  25. package/templates/minimal-app/apps/server/drizzle/0002_crazy_lilith.sql +46 -46
  26. package/templates/minimal-app/apps/server/drizzle/0003_freezing_fantastic_four.sql +3 -3
  27. package/templates/minimal-app/apps/server/drizzle/0004_slow_ezekiel_stane.sql +98 -98
  28. package/templates/minimal-app/apps/server/drizzle/0005_wonderful_the_professor.sql +1 -1
  29. package/templates/minimal-app/apps/server/drizzle/0006_lazy_blue_marvel.sql +158 -158
  30. package/templates/minimal-app/apps/server/drizzle/0007_abnormal_ultimo.sql +1 -1
  31. package/templates/minimal-app/apps/server/drizzle/0008_steady_nekra.sql +86 -86
  32. package/templates/minimal-app/apps/server/drizzle/0009_empty_starjammers.sql +45 -0
  33. package/templates/minimal-app/apps/server/drizzle/meta/0000_snapshot.json.tpl +2624 -2624
  34. package/templates/minimal-app/apps/server/drizzle/meta/0001_snapshot.json.tpl +2670 -2670
  35. package/templates/minimal-app/apps/server/drizzle/meta/0002_snapshot.json.tpl +2715 -2715
  36. package/templates/minimal-app/apps/server/drizzle/meta/0003_snapshot.json.tpl +2687 -2687
  37. package/templates/minimal-app/apps/server/drizzle/meta/0004_snapshot.json.tpl +2497 -2497
  38. package/templates/minimal-app/apps/server/drizzle/meta/0005_snapshot.json.tpl +2483 -2483
  39. package/templates/minimal-app/apps/server/drizzle/meta/0006_snapshot.json.tpl +3602 -3602
  40. package/templates/minimal-app/apps/server/drizzle/meta/0007_snapshot.json.tpl +3619 -3619
  41. package/templates/minimal-app/apps/server/drizzle/meta/0008_snapshot.json.tpl +3619 -3619
  42. package/templates/minimal-app/apps/server/drizzle/meta/0009_snapshot.json.tpl +3687 -0
  43. package/templates/minimal-app/apps/server/drizzle/meta/_journal.json.tpl +8 -1
  44. package/templates/minimal-app/apps/server/package.json.tpl +57 -57
  45. package/templates/minimal-app/apps/shared/package.json.tpl +27 -27
  46. package/templates/minimal-app/apps/webapp/AGENTS.md.tpl +24 -24
  47. package/templates/minimal-app/apps/webapp/index.html.tpl +22 -22
  48. package/templates/minimal-app/apps/webapp/package.json.tpl +53 -53
  49. package/templates/minimal-app/apps/webapp/public/logo.svg.tpl +6 -6
  50. package/templates/minimal-app/pnpm-workspace.yaml.tpl +15 -15
  51. package/templates/minimal-app/apps/expo/expo-env.d.ts.tpl +0 -3
  52. package/templates/minimal-app/apps/expo/uniwind-types.d.ts.tpl +0 -10
@@ -1,47 +1,47 @@
1
- CREATE TABLE `account_claims` (
2
- `id` text PRIMARY KEY NOT NULL,
3
- `claim_user_id` text NOT NULL,
4
- `status` text NOT NULL,
5
- `code` text,
6
- `expires_at` integer,
7
- `claimed_at` integer,
8
- `claimed_email` text,
9
- `created_at` integer NOT NULL,
10
- `updated_at` integer,
11
- FOREIGN KEY (`claim_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
12
- );
13
- --> statement-breakpoint
14
- PRAGMA foreign_keys=OFF;--> statement-breakpoint
15
- CREATE TABLE `__new_account_claim_magic_links` (
16
- `id` text PRIMARY KEY NOT NULL,
17
- `claim_id` text NOT NULL,
18
- `user_id` text NOT NULL,
19
- `email` text NOT NULL,
20
- `token` text NOT NULL,
21
- `url` text NOT NULL,
22
- `expires_at` integer,
23
- `created_at` integer NOT NULL,
24
- FOREIGN KEY (`claim_id`) REFERENCES `account_claims`(`id`) ON UPDATE no action ON DELETE cascade,
25
- FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
26
- );
27
- --> statement-breakpoint
28
- INSERT INTO `__new_account_claim_magic_links`("id", "claim_id", "user_id", "email", "token", "url", "expires_at", "created_at") SELECT "id", "claim_id", "user_id", "email", "token", "url", "expires_at", "created_at" FROM `account_claim_magic_links`;--> statement-breakpoint
29
- DROP TABLE `account_claim_magic_links`;--> statement-breakpoint
30
- ALTER TABLE `__new_account_claim_magic_links` RENAME TO `account_claim_magic_links`;--> statement-breakpoint
31
- PRAGMA foreign_keys=ON;--> statement-breakpoint
32
- CREATE TABLE `__new_waitlist` (
33
- `id` text PRIMARY KEY NOT NULL,
34
- `name` text,
35
- `email` text,
36
- `created_at` integer NOT NULL,
37
- `updated_at` integer,
38
- `status` text DEFAULT 'WAITLIST' NOT NULL,
39
- `code` text,
40
- `expires_at` integer,
41
- `user_id` text,
42
- FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
43
- );
44
- --> statement-breakpoint
45
- INSERT INTO `__new_waitlist`("id", "name", "email", "created_at", "updated_at", "status", "code", "expires_at", "user_id") SELECT "id", "name", "email", "created_at", "updated_at", "status", "code", "expires_at", "user_id" FROM `waitlist`;--> statement-breakpoint
46
- DROP TABLE `waitlist`;--> statement-breakpoint
1
+ CREATE TABLE `account_claims` (
2
+ `id` text PRIMARY KEY NOT NULL,
3
+ `claim_user_id` text NOT NULL,
4
+ `status` text NOT NULL,
5
+ `code` text,
6
+ `expires_at` integer,
7
+ `claimed_at` integer,
8
+ `claimed_email` text,
9
+ `created_at` integer NOT NULL,
10
+ `updated_at` integer,
11
+ FOREIGN KEY (`claim_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
12
+ );
13
+ --> statement-breakpoint
14
+ PRAGMA foreign_keys=OFF;--> statement-breakpoint
15
+ CREATE TABLE `__new_account_claim_magic_links` (
16
+ `id` text PRIMARY KEY NOT NULL,
17
+ `claim_id` text NOT NULL,
18
+ `user_id` text NOT NULL,
19
+ `email` text NOT NULL,
20
+ `token` text NOT NULL,
21
+ `url` text NOT NULL,
22
+ `expires_at` integer,
23
+ `created_at` integer NOT NULL,
24
+ FOREIGN KEY (`claim_id`) REFERENCES `account_claims`(`id`) ON UPDATE no action ON DELETE cascade,
25
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
26
+ );
27
+ --> statement-breakpoint
28
+ INSERT INTO `__new_account_claim_magic_links`("id", "claim_id", "user_id", "email", "token", "url", "expires_at", "created_at") SELECT "id", "claim_id", "user_id", "email", "token", "url", "expires_at", "created_at" FROM `account_claim_magic_links`;--> statement-breakpoint
29
+ DROP TABLE `account_claim_magic_links`;--> statement-breakpoint
30
+ ALTER TABLE `__new_account_claim_magic_links` RENAME TO `account_claim_magic_links`;--> statement-breakpoint
31
+ PRAGMA foreign_keys=ON;--> statement-breakpoint
32
+ CREATE TABLE `__new_waitlist` (
33
+ `id` text PRIMARY KEY NOT NULL,
34
+ `name` text,
35
+ `email` text,
36
+ `created_at` integer NOT NULL,
37
+ `updated_at` integer,
38
+ `status` text DEFAULT 'WAITLIST' NOT NULL,
39
+ `code` text,
40
+ `expires_at` integer,
41
+ `user_id` text,
42
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
43
+ );
44
+ --> statement-breakpoint
45
+ INSERT INTO `__new_waitlist`("id", "name", "email", "created_at", "updated_at", "status", "code", "expires_at", "user_id") SELECT "id", "name", "email", "created_at", "updated_at", "status", "code", "expires_at", "user_id" FROM `waitlist`;--> statement-breakpoint
46
+ DROP TABLE `waitlist`;--> statement-breakpoint
47
47
  ALTER TABLE `__new_waitlist` RENAME TO `waitlist`;
@@ -1,4 +1,4 @@
1
- DROP INDEX `users_payment_customer_id_unique`;--> statement-breakpoint
2
- ALTER TABLE `users` DROP COLUMN `payment_customer_id`;--> statement-breakpoint
3
- ALTER TABLE `users` DROP COLUMN `payment_plan_tier`;--> statement-breakpoint
1
+ DROP INDEX `users_payment_customer_id_unique`;--> statement-breakpoint
2
+ ALTER TABLE `users` DROP COLUMN `payment_customer_id`;--> statement-breakpoint
3
+ ALTER TABLE `users` DROP COLUMN `payment_plan_tier`;--> statement-breakpoint
4
4
  ALTER TABLE `users` DROP COLUMN `payment_plan_expires_at`;
@@ -1,99 +1,99 @@
1
- DROP TABLE `teammembers`;--> statement-breakpoint
2
- DROP TABLE `teams`;--> statement-breakpoint
3
- PRAGMA foreign_keys=OFF;--> statement-breakpoint
4
- CREATE TABLE `__new_ai_usage` (
5
- `id` text PRIMARY KEY NOT NULL,
6
- `user_id` text,
7
- `member_id` text,
8
- `team_id` text,
9
- `organization_id` text,
10
- `feature` text NOT NULL,
11
- `provider` text NOT NULL,
12
- `model` text NOT NULL,
13
- `input_tokens` integer,
14
- `output_tokens` integer,
15
- `total_tokens` integer,
16
- `cost` real,
17
- `trace_id` text,
18
- `created_at` integer NOT NULL,
19
- `metadata` text,
20
- FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null,
21
- FOREIGN KEY (`member_id`) REFERENCES `members`(`id`) ON UPDATE no action ON DELETE set null,
22
- FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`) ON UPDATE no action ON DELETE set null
23
- );
24
- --> statement-breakpoint
25
- INSERT INTO `__new_ai_usage`("id", "user_id", "member_id", "team_id", "organization_id", "feature", "provider", "model", "input_tokens", "output_tokens", "total_tokens", "cost", "trace_id", "created_at", "metadata") SELECT "id", "user_id", "member_id", "team_id", "organization_id", "feature", "provider", "model", "input_tokens", "output_tokens", "total_tokens", "cost", "trace_id", "created_at", "metadata" FROM `ai_usage`;--> statement-breakpoint
26
- DROP TABLE `ai_usage`;--> statement-breakpoint
27
- ALTER TABLE `__new_ai_usage` RENAME TO `ai_usage`;--> statement-breakpoint
28
- PRAGMA foreign_keys=ON;--> statement-breakpoint
29
- CREATE TABLE `__new_files` (
30
- `id` text PRIMARY KEY NOT NULL,
31
- `created_at` integer NOT NULL,
32
- `updated_at` integer,
33
- `deleted_at` integer,
34
- `user_id` text,
35
- `member_id` text,
36
- `organization_id` text,
37
- `team_id` text,
38
- `bucket` text NOT NULL,
39
- `key` text NOT NULL,
40
- `original_name` text NOT NULL,
41
- `original_extension` text,
42
- `content_type` text NOT NULL,
43
- `size_bytes` integer,
44
- `etag` text,
45
- `checksum_sha256` text,
46
- `metadata` text,
47
- `status` text NOT NULL,
48
- `uploaded_at` integer,
49
- FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null,
50
- FOREIGN KEY (`member_id`) REFERENCES `members`(`id`) ON UPDATE no action ON DELETE set null,
51
- FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`) ON UPDATE no action ON DELETE set null
52
- );
53
- --> statement-breakpoint
54
- INSERT INTO `__new_files`("id", "created_at", "updated_at", "deleted_at", "user_id", "member_id", "organization_id", "team_id", "bucket", "key", "original_name", "original_extension", "content_type", "size_bytes", "etag", "checksum_sha256", "metadata", "status", "uploaded_at") SELECT "id", "created_at", "updated_at", "deleted_at", "user_id", "member_id", "organization_id", "team_id", "bucket", "key", "original_name", "original_extension", "content_type", "size_bytes", "etag", "checksum_sha256", "metadata", "status", "uploaded_at" FROM `files`;--> statement-breakpoint
55
- DROP TABLE `files`;--> statement-breakpoint
56
- ALTER TABLE `__new_files` RENAME TO `files`;--> statement-breakpoint
57
- CREATE UNIQUE INDEX `files_bucket_key_unique` ON `files` (`bucket`,`key`);--> statement-breakpoint
58
- CREATE TABLE `__new_invitations` (
59
- `id` text PRIMARY KEY NOT NULL,
60
- `organization_id` text NOT NULL,
61
- `member_id` text,
62
- `email` text NOT NULL,
63
- `role` text,
64
- `status` text NOT NULL,
65
- `created_at` integer NOT NULL,
66
- `expires_at` integer NOT NULL,
67
- `inviter_id` text NOT NULL,
68
- FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`) ON UPDATE no action ON DELETE no action,
69
- FOREIGN KEY (`member_id`) REFERENCES `members`(`id`) ON UPDATE no action ON DELETE no action,
70
- FOREIGN KEY (`inviter_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
71
- );
72
- --> statement-breakpoint
73
- INSERT INTO `__new_invitations`("id", "organization_id", "member_id", "email", "role", "status", "created_at", "expires_at", "inviter_id") SELECT "id", "organization_id", "member_id", "email", "role", "status", "created_at", "expires_at", "inviter_id" FROM `invitations`;--> statement-breakpoint
74
- DROP TABLE `invitations`;--> statement-breakpoint
75
- ALTER TABLE `__new_invitations` RENAME TO `invitations`;--> statement-breakpoint
76
- CREATE TABLE `__new_posts` (
77
- `id` text PRIMARY KEY NOT NULL,
78
- `author_user_id` text,
79
- `member_id` text,
80
- `organization_id` text,
81
- `team_id` text,
82
- `title` text NOT NULL,
83
- `slug` text NOT NULL,
84
- `excerpt` text,
85
- `content` text NOT NULL,
86
- `status` text DEFAULT 'draft' NOT NULL,
87
- `published_at` integer,
88
- `created_at` integer NOT NULL,
89
- `updated_at` integer,
90
- `deleted_at` integer,
91
- FOREIGN KEY (`author_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null,
92
- FOREIGN KEY (`member_id`) REFERENCES `members`(`id`) ON UPDATE no action ON DELETE set null,
93
- FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`) ON UPDATE no action ON DELETE set null
94
- );
95
- --> statement-breakpoint
96
- INSERT INTO `__new_posts`("id", "author_user_id", "member_id", "organization_id", "team_id", "title", "slug", "excerpt", "content", "status", "published_at", "created_at", "updated_at", "deleted_at") SELECT "id", "author_user_id", "member_id", "organization_id", "team_id", "title", "slug", "excerpt", "content", "status", "published_at", "created_at", "updated_at", "deleted_at" FROM `posts`;--> statement-breakpoint
97
- DROP TABLE `posts`;--> statement-breakpoint
98
- ALTER TABLE `__new_posts` RENAME TO `posts`;--> statement-breakpoint
1
+ DROP TABLE `teammembers`;--> statement-breakpoint
2
+ DROP TABLE `teams`;--> statement-breakpoint
3
+ PRAGMA foreign_keys=OFF;--> statement-breakpoint
4
+ CREATE TABLE `__new_ai_usage` (
5
+ `id` text PRIMARY KEY NOT NULL,
6
+ `user_id` text,
7
+ `member_id` text,
8
+ `team_id` text,
9
+ `organization_id` text,
10
+ `feature` text NOT NULL,
11
+ `provider` text NOT NULL,
12
+ `model` text NOT NULL,
13
+ `input_tokens` integer,
14
+ `output_tokens` integer,
15
+ `total_tokens` integer,
16
+ `cost` real,
17
+ `trace_id` text,
18
+ `created_at` integer NOT NULL,
19
+ `metadata` text,
20
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null,
21
+ FOREIGN KEY (`member_id`) REFERENCES `members`(`id`) ON UPDATE no action ON DELETE set null,
22
+ FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`) ON UPDATE no action ON DELETE set null
23
+ );
24
+ --> statement-breakpoint
25
+ INSERT INTO `__new_ai_usage`("id", "user_id", "member_id", "team_id", "organization_id", "feature", "provider", "model", "input_tokens", "output_tokens", "total_tokens", "cost", "trace_id", "created_at", "metadata") SELECT "id", "user_id", "member_id", "team_id", "organization_id", "feature", "provider", "model", "input_tokens", "output_tokens", "total_tokens", "cost", "trace_id", "created_at", "metadata" FROM `ai_usage`;--> statement-breakpoint
26
+ DROP TABLE `ai_usage`;--> statement-breakpoint
27
+ ALTER TABLE `__new_ai_usage` RENAME TO `ai_usage`;--> statement-breakpoint
28
+ PRAGMA foreign_keys=ON;--> statement-breakpoint
29
+ CREATE TABLE `__new_files` (
30
+ `id` text PRIMARY KEY NOT NULL,
31
+ `created_at` integer NOT NULL,
32
+ `updated_at` integer,
33
+ `deleted_at` integer,
34
+ `user_id` text,
35
+ `member_id` text,
36
+ `organization_id` text,
37
+ `team_id` text,
38
+ `bucket` text NOT NULL,
39
+ `key` text NOT NULL,
40
+ `original_name` text NOT NULL,
41
+ `original_extension` text,
42
+ `content_type` text NOT NULL,
43
+ `size_bytes` integer,
44
+ `etag` text,
45
+ `checksum_sha256` text,
46
+ `metadata` text,
47
+ `status` text NOT NULL,
48
+ `uploaded_at` integer,
49
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null,
50
+ FOREIGN KEY (`member_id`) REFERENCES `members`(`id`) ON UPDATE no action ON DELETE set null,
51
+ FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`) ON UPDATE no action ON DELETE set null
52
+ );
53
+ --> statement-breakpoint
54
+ INSERT INTO `__new_files`("id", "created_at", "updated_at", "deleted_at", "user_id", "member_id", "organization_id", "team_id", "bucket", "key", "original_name", "original_extension", "content_type", "size_bytes", "etag", "checksum_sha256", "metadata", "status", "uploaded_at") SELECT "id", "created_at", "updated_at", "deleted_at", "user_id", "member_id", "organization_id", "team_id", "bucket", "key", "original_name", "original_extension", "content_type", "size_bytes", "etag", "checksum_sha256", "metadata", "status", "uploaded_at" FROM `files`;--> statement-breakpoint
55
+ DROP TABLE `files`;--> statement-breakpoint
56
+ ALTER TABLE `__new_files` RENAME TO `files`;--> statement-breakpoint
57
+ CREATE UNIQUE INDEX `files_bucket_key_unique` ON `files` (`bucket`,`key`);--> statement-breakpoint
58
+ CREATE TABLE `__new_invitations` (
59
+ `id` text PRIMARY KEY NOT NULL,
60
+ `organization_id` text NOT NULL,
61
+ `member_id` text,
62
+ `email` text NOT NULL,
63
+ `role` text,
64
+ `status` text NOT NULL,
65
+ `created_at` integer NOT NULL,
66
+ `expires_at` integer NOT NULL,
67
+ `inviter_id` text NOT NULL,
68
+ FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`) ON UPDATE no action ON DELETE no action,
69
+ FOREIGN KEY (`member_id`) REFERENCES `members`(`id`) ON UPDATE no action ON DELETE no action,
70
+ FOREIGN KEY (`inviter_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
71
+ );
72
+ --> statement-breakpoint
73
+ INSERT INTO `__new_invitations`("id", "organization_id", "member_id", "email", "role", "status", "created_at", "expires_at", "inviter_id") SELECT "id", "organization_id", "member_id", "email", "role", "status", "created_at", "expires_at", "inviter_id" FROM `invitations`;--> statement-breakpoint
74
+ DROP TABLE `invitations`;--> statement-breakpoint
75
+ ALTER TABLE `__new_invitations` RENAME TO `invitations`;--> statement-breakpoint
76
+ CREATE TABLE `__new_posts` (
77
+ `id` text PRIMARY KEY NOT NULL,
78
+ `author_user_id` text,
79
+ `member_id` text,
80
+ `organization_id` text,
81
+ `team_id` text,
82
+ `title` text NOT NULL,
83
+ `slug` text NOT NULL,
84
+ `excerpt` text,
85
+ `content` text NOT NULL,
86
+ `status` text DEFAULT 'draft' NOT NULL,
87
+ `published_at` integer,
88
+ `created_at` integer NOT NULL,
89
+ `updated_at` integer,
90
+ `deleted_at` integer,
91
+ FOREIGN KEY (`author_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null,
92
+ FOREIGN KEY (`member_id`) REFERENCES `members`(`id`) ON UPDATE no action ON DELETE set null,
93
+ FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`) ON UPDATE no action ON DELETE set null
94
+ );
95
+ --> statement-breakpoint
96
+ INSERT INTO `__new_posts`("id", "author_user_id", "member_id", "organization_id", "team_id", "title", "slug", "excerpt", "content", "status", "published_at", "created_at", "updated_at", "deleted_at") SELECT "id", "author_user_id", "member_id", "organization_id", "team_id", "title", "slug", "excerpt", "content", "status", "published_at", "created_at", "updated_at", "deleted_at" FROM `posts`;--> statement-breakpoint
97
+ DROP TABLE `posts`;--> statement-breakpoint
98
+ ALTER TABLE `__new_posts` RENAME TO `posts`;--> statement-breakpoint
99
99
  CREATE UNIQUE INDEX `posts_slug_unique` ON `posts` (`slug`);
@@ -1,2 +1,2 @@
1
- ALTER TABLE `sessions` DROP COLUMN `active_team_id`;--> statement-breakpoint
1
+ ALTER TABLE `sessions` DROP COLUMN `active_team_id`;--> statement-breakpoint
2
2
  ALTER TABLE `sessions` DROP COLUMN `active_team_role`;
@@ -1,159 +1,159 @@
1
- CREATE TABLE `jwks` (
2
- `id` text PRIMARY KEY NOT NULL,
3
- `public_key` text NOT NULL,
4
- `private_key` text NOT NULL,
5
- `created_at` integer NOT NULL,
6
- `expires_at` integer,
7
- `alg` text,
8
- `crv` text
9
- );
10
- --> statement-breakpoint
11
- CREATE TABLE `mcp_allowlist_entries` (
12
- `id` text PRIMARY KEY NOT NULL,
13
- `oauth_client_id` text NOT NULL,
14
- `user_id` text NOT NULL,
15
- `organization_id` text NOT NULL,
16
- `created_at` integer NOT NULL,
17
- FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
18
- FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`) ON UPDATE no action ON DELETE cascade
19
- );
20
- --> statement-breakpoint
21
- CREATE UNIQUE INDEX `mcp_allowlist_client_user_org_unique` ON `mcp_allowlist_entries` (`oauth_client_id`,`user_id`,`organization_id`);--> statement-breakpoint
22
- CREATE TABLE `oauth_access_tokens` (
23
- `id` text PRIMARY KEY NOT NULL,
24
- `token` text,
25
- `client_id` text NOT NULL,
26
- `session_id` text,
27
- `user_id` text,
28
- `reference_id` text,
29
- `authorization_code_id` text,
30
- `resources` text,
31
- `requested_user_info_claims` text,
32
- `refresh_id` text,
33
- `expires_at` integer NOT NULL,
34
- `created_at` integer NOT NULL,
35
- `revoked` integer,
36
- `confirmation` text,
37
- `scopes` text NOT NULL,
38
- FOREIGN KEY (`client_id`) REFERENCES `oauth_clients`(`id`) ON UPDATE no action ON DELETE no action,
39
- FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE set null,
40
- FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action,
41
- FOREIGN KEY (`refresh_id`) REFERENCES `oauth_refresh_tokens`(`id`) ON UPDATE no action ON DELETE no action
42
- );
43
- --> statement-breakpoint
44
- CREATE UNIQUE INDEX `oauth_access_tokens_token_unique` ON `oauth_access_tokens` (`token`);--> statement-breakpoint
45
- CREATE TABLE `oauth_client_assertions` (
46
- `id` text PRIMARY KEY NOT NULL,
47
- `expires_at` integer NOT NULL
48
- );
49
- --> statement-breakpoint
50
- CREATE TABLE `oauth_client_resources` (
51
- `id` text PRIMARY KEY NOT NULL,
52
- `client_id` text NOT NULL,
53
- `resource_id` text NOT NULL,
54
- `metadata` text,
55
- `created_at` integer,
56
- FOREIGN KEY (`client_id`) REFERENCES `oauth_clients`(`id`) ON UPDATE no action ON DELETE cascade,
57
- FOREIGN KEY (`resource_id`) REFERENCES `oauth_resources`(`id`) ON UPDATE no action ON DELETE cascade
58
- );
59
- --> statement-breakpoint
60
- CREATE UNIQUE INDEX `oauth_client_resources_client_resource_unique` ON `oauth_client_resources` (`client_id`,`resource_id`);--> statement-breakpoint
61
- CREATE TABLE `oauth_clients` (
62
- `id` text PRIMARY KEY NOT NULL,
63
- `client_id` text NOT NULL,
64
- `client_secret` text,
65
- `client_discovery_id` text,
66
- `disabled` integer DEFAULT false,
67
- `skip_consent` integer,
68
- `enable_end_session` integer,
69
- `subject_type` text,
70
- `scopes` text,
71
- `client_credentials_scopes` text DEFAULT '[]',
72
- `user_id` text,
73
- `created_at` integer,
74
- `updated_at` integer,
75
- `name` text,
76
- `uri` text,
77
- `icon` text,
78
- `contacts` text,
79
- `tos` text,
80
- `policy` text,
81
- `software_id` text,
82
- `software_version` text,
83
- `software_statement` text,
84
- `redirect_uris` text NOT NULL,
85
- `post_logout_redirect_uris` text,
86
- `backchannel_logout_uri` text,
87
- `backchannel_logout_session_required` integer,
88
- `token_endpoint_auth_method` text,
89
- `application_type` text,
90
- `jwks` text,
91
- `jwks_uri` text,
92
- `grant_types` text,
93
- `response_types` text,
94
- `require_pkce` integer,
95
- `dpop_bound_access_tokens` integer DEFAULT false,
96
- `reference_id` text,
97
- `metadata` text,
98
- FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
99
- );
100
- --> statement-breakpoint
101
- CREATE UNIQUE INDEX `oauth_clients_client_id_unique` ON `oauth_clients` (`client_id`);--> statement-breakpoint
102
- CREATE TABLE `oauth_consents` (
103
- `id` text PRIMARY KEY NOT NULL,
104
- `client_id` text NOT NULL,
105
- `user_id` text,
106
- `reference_id` text,
107
- `resources` text,
108
- `requested_user_info_claims` text,
109
- `scopes` text NOT NULL,
110
- `created_at` integer NOT NULL,
111
- `updated_at` integer NOT NULL,
112
- FOREIGN KEY (`client_id`) REFERENCES `oauth_clients`(`id`) ON UPDATE no action ON DELETE no action,
113
- FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
114
- );
115
- --> statement-breakpoint
116
- CREATE TABLE `oauth_refresh_tokens` (
117
- `id` text PRIMARY KEY NOT NULL,
118
- `token` text NOT NULL,
119
- `client_id` text NOT NULL,
120
- `session_id` text,
121
- `user_id` text NOT NULL,
122
- `reference_id` text,
123
- `authorization_code_id` text,
124
- `resources` text,
125
- `requested_user_info_claims` text,
126
- `expires_at` integer NOT NULL,
127
- `created_at` integer NOT NULL,
128
- `revoked` integer,
129
- `rotated_at` integer,
130
- `rotation_replay_response` text,
131
- `rotation_replay_expires_at` integer,
132
- `auth_time` integer,
133
- `confirmation` text,
134
- `scopes` text NOT NULL,
135
- FOREIGN KEY (`client_id`) REFERENCES `oauth_clients`(`id`) ON UPDATE no action ON DELETE no action,
136
- FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE set null,
137
- FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
138
- );
139
- --> statement-breakpoint
140
- CREATE UNIQUE INDEX `oauth_refresh_tokens_token_unique` ON `oauth_refresh_tokens` (`token`);--> statement-breakpoint
141
- CREATE TABLE `oauth_resources` (
142
- `id` text PRIMARY KEY NOT NULL,
143
- `identifier` text NOT NULL,
144
- `name` text NOT NULL,
145
- `access_token_ttl` integer,
146
- `refresh_token_ttl` integer,
147
- `signing_algorithm` text,
148
- `signing_key_id` text,
149
- `allowed_scopes` text,
150
- `custom_claims` text,
151
- `dpop_bound_access_tokens_required` integer DEFAULT false,
152
- `disabled` integer DEFAULT false,
153
- `created_at` integer,
154
- `updated_at` integer,
155
- `policy_version` integer DEFAULT 1,
156
- `metadata` text
157
- );
158
- --> statement-breakpoint
1
+ CREATE TABLE `jwks` (
2
+ `id` text PRIMARY KEY NOT NULL,
3
+ `public_key` text NOT NULL,
4
+ `private_key` text NOT NULL,
5
+ `created_at` integer NOT NULL,
6
+ `expires_at` integer,
7
+ `alg` text,
8
+ `crv` text
9
+ );
10
+ --> statement-breakpoint
11
+ CREATE TABLE `mcp_allowlist_entries` (
12
+ `id` text PRIMARY KEY NOT NULL,
13
+ `oauth_client_id` text NOT NULL,
14
+ `user_id` text NOT NULL,
15
+ `organization_id` text NOT NULL,
16
+ `created_at` integer NOT NULL,
17
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
18
+ FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`) ON UPDATE no action ON DELETE cascade
19
+ );
20
+ --> statement-breakpoint
21
+ CREATE UNIQUE INDEX `mcp_allowlist_client_user_org_unique` ON `mcp_allowlist_entries` (`oauth_client_id`,`user_id`,`organization_id`);--> statement-breakpoint
22
+ CREATE TABLE `oauth_access_tokens` (
23
+ `id` text PRIMARY KEY NOT NULL,
24
+ `token` text,
25
+ `client_id` text NOT NULL,
26
+ `session_id` text,
27
+ `user_id` text,
28
+ `reference_id` text,
29
+ `authorization_code_id` text,
30
+ `resources` text,
31
+ `requested_user_info_claims` text,
32
+ `refresh_id` text,
33
+ `expires_at` integer NOT NULL,
34
+ `created_at` integer NOT NULL,
35
+ `revoked` integer,
36
+ `confirmation` text,
37
+ `scopes` text NOT NULL,
38
+ FOREIGN KEY (`client_id`) REFERENCES `oauth_clients`(`id`) ON UPDATE no action ON DELETE no action,
39
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE set null,
40
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action,
41
+ FOREIGN KEY (`refresh_id`) REFERENCES `oauth_refresh_tokens`(`id`) ON UPDATE no action ON DELETE no action
42
+ );
43
+ --> statement-breakpoint
44
+ CREATE UNIQUE INDEX `oauth_access_tokens_token_unique` ON `oauth_access_tokens` (`token`);--> statement-breakpoint
45
+ CREATE TABLE `oauth_client_assertions` (
46
+ `id` text PRIMARY KEY NOT NULL,
47
+ `expires_at` integer NOT NULL
48
+ );
49
+ --> statement-breakpoint
50
+ CREATE TABLE `oauth_client_resources` (
51
+ `id` text PRIMARY KEY NOT NULL,
52
+ `client_id` text NOT NULL,
53
+ `resource_id` text NOT NULL,
54
+ `metadata` text,
55
+ `created_at` integer,
56
+ FOREIGN KEY (`client_id`) REFERENCES `oauth_clients`(`id`) ON UPDATE no action ON DELETE cascade,
57
+ FOREIGN KEY (`resource_id`) REFERENCES `oauth_resources`(`id`) ON UPDATE no action ON DELETE cascade
58
+ );
59
+ --> statement-breakpoint
60
+ CREATE UNIQUE INDEX `oauth_client_resources_client_resource_unique` ON `oauth_client_resources` (`client_id`,`resource_id`);--> statement-breakpoint
61
+ CREATE TABLE `oauth_clients` (
62
+ `id` text PRIMARY KEY NOT NULL,
63
+ `client_id` text NOT NULL,
64
+ `client_secret` text,
65
+ `client_discovery_id` text,
66
+ `disabled` integer DEFAULT false,
67
+ `skip_consent` integer,
68
+ `enable_end_session` integer,
69
+ `subject_type` text,
70
+ `scopes` text,
71
+ `client_credentials_scopes` text DEFAULT '[]',
72
+ `user_id` text,
73
+ `created_at` integer,
74
+ `updated_at` integer,
75
+ `name` text,
76
+ `uri` text,
77
+ `icon` text,
78
+ `contacts` text,
79
+ `tos` text,
80
+ `policy` text,
81
+ `software_id` text,
82
+ `software_version` text,
83
+ `software_statement` text,
84
+ `redirect_uris` text NOT NULL,
85
+ `post_logout_redirect_uris` text,
86
+ `backchannel_logout_uri` text,
87
+ `backchannel_logout_session_required` integer,
88
+ `token_endpoint_auth_method` text,
89
+ `application_type` text,
90
+ `jwks` text,
91
+ `jwks_uri` text,
92
+ `grant_types` text,
93
+ `response_types` text,
94
+ `require_pkce` integer,
95
+ `dpop_bound_access_tokens` integer DEFAULT false,
96
+ `reference_id` text,
97
+ `metadata` text,
98
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
99
+ );
100
+ --> statement-breakpoint
101
+ CREATE UNIQUE INDEX `oauth_clients_client_id_unique` ON `oauth_clients` (`client_id`);--> statement-breakpoint
102
+ CREATE TABLE `oauth_consents` (
103
+ `id` text PRIMARY KEY NOT NULL,
104
+ `client_id` text NOT NULL,
105
+ `user_id` text,
106
+ `reference_id` text,
107
+ `resources` text,
108
+ `requested_user_info_claims` text,
109
+ `scopes` text NOT NULL,
110
+ `created_at` integer NOT NULL,
111
+ `updated_at` integer NOT NULL,
112
+ FOREIGN KEY (`client_id`) REFERENCES `oauth_clients`(`id`) ON UPDATE no action ON DELETE no action,
113
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
114
+ );
115
+ --> statement-breakpoint
116
+ CREATE TABLE `oauth_refresh_tokens` (
117
+ `id` text PRIMARY KEY NOT NULL,
118
+ `token` text NOT NULL,
119
+ `client_id` text NOT NULL,
120
+ `session_id` text,
121
+ `user_id` text NOT NULL,
122
+ `reference_id` text,
123
+ `authorization_code_id` text,
124
+ `resources` text,
125
+ `requested_user_info_claims` text,
126
+ `expires_at` integer NOT NULL,
127
+ `created_at` integer NOT NULL,
128
+ `revoked` integer,
129
+ `rotated_at` integer,
130
+ `rotation_replay_response` text,
131
+ `rotation_replay_expires_at` integer,
132
+ `auth_time` integer,
133
+ `confirmation` text,
134
+ `scopes` text NOT NULL,
135
+ FOREIGN KEY (`client_id`) REFERENCES `oauth_clients`(`id`) ON UPDATE no action ON DELETE no action,
136
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE set null,
137
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
138
+ );
139
+ --> statement-breakpoint
140
+ CREATE UNIQUE INDEX `oauth_refresh_tokens_token_unique` ON `oauth_refresh_tokens` (`token`);--> statement-breakpoint
141
+ CREATE TABLE `oauth_resources` (
142
+ `id` text PRIMARY KEY NOT NULL,
143
+ `identifier` text NOT NULL,
144
+ `name` text NOT NULL,
145
+ `access_token_ttl` integer,
146
+ `refresh_token_ttl` integer,
147
+ `signing_algorithm` text,
148
+ `signing_key_id` text,
149
+ `allowed_scopes` text,
150
+ `custom_claims` text,
151
+ `dpop_bound_access_tokens_required` integer DEFAULT false,
152
+ `disabled` integer DEFAULT false,
153
+ `created_at` integer,
154
+ `updated_at` integer,
155
+ `policy_version` integer DEFAULT 1,
156
+ `metadata` text
157
+ );
158
+ --> statement-breakpoint
159
159
  CREATE UNIQUE INDEX `oauth_resources_identifier_unique` ON `oauth_resources` (`identifier`);
@@ -1,2 +1,2 @@
1
- ALTER TABLE `accounts` ADD `issuer` text DEFAULT 'local:credential' NOT NULL;--> statement-breakpoint
1
+ ALTER TABLE `accounts` ADD `issuer` text DEFAULT 'local:credential' NOT NULL;--> statement-breakpoint
2
2
  CREATE UNIQUE INDEX `accounts_issuer_account_id_unique` ON `accounts` (`issuer`,`account_id`);