Skip to content

Commit

Permalink
ユーザーモデルのemailフィールドを必須に変更し、マイグレーションを追加しました (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttizze authored Feb 5, 2025
2 parents cdb19a1 + fd0f13b commit 83272ec
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions web/app/features/translate/lib/translate.server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ describe("translate関数の単体テスト (Gemini呼び出しのみモック)"
handle: "testuser",
name: "testuser",
image: "testuser",
email: "[email protected]",
},
});
userId = user.id;
Expand Down
2 changes: 2 additions & 0 deletions web/app/routes/$locale+/user.$handle+/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe("UserProfile", () => {
name: "Test User",
image: "https://example.com/image.jpg",
profile: "This is a test profile",
email: "[email protected]",
pages: {
create: [
{
Expand Down Expand Up @@ -72,6 +73,7 @@ describe("UserProfile", () => {
name: "Test User2",
image: "https://example.com/image2.jpg",
profile: "This is a test profile2",
email: "[email protected]",
},
});
testUser = createdUser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ describe("EditPage", () => {
name: "Test User",
image: "https://example.com/image.jpg",
profile: "This is a test profile",
email: "[email protected]",
pages: {
create: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ describe("processHtmlContent", () => {
handle: "htmltester",
name: "htmltester",
image: "htmltester",
email: "[email protected]",
},
update: {},
});
Expand Down Expand Up @@ -80,6 +81,7 @@ describe("processHtmlContent", () => {
handle: "htmleditor",
name: "htmleditor",
image: "htmleditor",
email: "[email protected]",
},
update: {},
});
Expand Down Expand Up @@ -175,6 +177,7 @@ describe("processHtmlContent", () => {
handle: "titleduplicateuser",
name: "titleduplicateuser",
image: "titleduplicateuser",
email: "[email protected]",
},
update: {},
});
Expand Down Expand Up @@ -253,6 +256,7 @@ describe("processHtmlContent", () => {
handle: "noedit",
name: "noedit",
image: "noedit",
email: "[email protected]",
},
update: {},
});
Expand Down Expand Up @@ -315,6 +319,7 @@ describe("processHtmlContent", () => {
handle: "imagetester",
name: "imagetester",
image: "imagetester",
email: "[email protected]",
},
update: {},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ describe("toggleLike 実際のDB統合テスト", () => {
name: "Test User",
image: "https://example.com/image.jpg",
profile: "This is a test profile",
email: "[email protected]",
pages: {
create: [
{
Expand Down
8 changes: 8 additions & 0 deletions web/prisma/migrations/20250205084608_/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
Warnings:
- Made the column `email` on table `users` required. This step will fail if there are existing NULL values in that column.
*/
-- AlterTable
ALTER TABLE "users" ALTER COLUMN "email" SET NOT NULL;
2 changes: 1 addition & 1 deletion web/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ datasource db {
model User {
id String @id @default(cuid())
handle String @unique
email String? @unique
email String @unique
name String
image String
profile String @default("")
Expand Down
4 changes: 4 additions & 0 deletions web/scripts/processMarkdownContent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This is another test.
handle: "test",
name: "test",
image: "test",
email: "[email protected]",
},
update: {},
});
Expand Down Expand Up @@ -95,6 +96,7 @@ This is another line.
handle: "editor",
name: "editor",
image: "editor",
email: "[email protected]",
},
update: {},
});
Expand Down Expand Up @@ -210,6 +212,7 @@ new line
handle: "variety",
name: "variety",
image: "variety",
email: "[email protected]",
},
update: {},
});
Expand Down Expand Up @@ -281,6 +284,7 @@ new line
handle: "variety",
name: "variety",
image: "variety",
email: "[email protected]",
},
update: {},
});
Expand Down

0 comments on commit 83272ec

Please sign in to comment.