Skip to content

Commit

Permalink
add timezone config to prisma schema
Browse files Browse the repository at this point in the history
  • Loading branch information
koyopro committed Jan 11, 2025
1 parent 4f8468c commit 0f47764
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/minimal/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ generator custom_generator {

datasource db {
provider = "mysql"
url = "mysql://root:@localhost:3306/accel_test_minimal"
url = "mysql://root:@localhost:3306/accel_test_minimal?timezone=Z"
}

model User {
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal/src/models/_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const dataSource = {
activeProvider: "mysql",
url: {
fromEnvVar: null,
value: "mysql://root:@localhost:3306/accel_test_minimal",
value: "mysql://root:@localhost:3306/accel_test_minimal?timezone=Z",
},
schemas: [],
} as DataSource;
Expand Down
2 changes: 1 addition & 1 deletion tests/models/_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ export const dataSource = {
"activeProvider": "mysql",
"url": {
"fromEnvVar": null,
"value": "mysql://root:@localhost:3306/accel_test1"
"value": "mysql://root:@localhost:3306/accel_test1?timezone=Z"
},
"schemas": []
} as DataSource;
Expand Down
4 changes: 2 additions & 2 deletions tests/models/dataSource.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test("dataSource", () => {
activeProvider: "mysql",
url: {
fromEnvVar: null,
value: "mysql://root:@localhost:3306/accel_test1",
value: "mysql://root:@localhost:3306/accel_test1?timezone=Z",
},
schemas: [],
});
Expand Down Expand Up @@ -51,7 +51,7 @@ test("getDatabaseConfig()", () => {
case "mysql":
expect(config).toMatchObject({
type: "mysql",
datasourceUrl: "mysql://root:@localhost:3306/accel_test1",
datasourceUrl: "mysql://root:@localhost:3306/accel_test1?timezone=Z",
prismaDir: new RegExp("/.+/tests/prisma_mysql"),
});
break;
Expand Down
2 changes: 1 addition & 1 deletion tests/prisma_mysql/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ generator custom_generator {

datasource db {
provider = "mysql"
url = "mysql://root:@localhost:3306/accel_test1"
url = "mysql://root:@localhost:3306/accel_test1?timezone=Z"
}

model User {
Expand Down

0 comments on commit 0f47764

Please sign in to comment.