Skip to content
This repository was archived by the owner on Nov 10, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions packages/console/core/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import { Resource } from "sst"
import { defineConfig } from "drizzle-kit"

// drizzle-kit drops ssl options it does not list, including mysql2's verifyIdentity, and mysql2 skips the
// hostname check without it. Options in the URL reach mysql2 unchanged.
const ssl = encodeURIComponent(JSON.stringify({ rejectUnauthorized: true, verifyIdentity: true }))

export default defineConfig({
out: "./migrations/",
strict: true,
schema: ["./src/**/*.sql.ts"],
verbose: true,
dialect: "mysql",
dbCredentials: {
database: Resource.Database.database,
host: Resource.Database.host,
user: Resource.Database.username,
password: Resource.Database.password,
port: Resource.Database.port,
ssl: {
rejectUnauthorized: false,
},
url: `mysql://${encodeURIComponent(Resource.Database.username)}:${encodeURIComponent(Resource.Database.password)}@${Resource.Database.host}:${Resource.Database.port}/${Resource.Database.database}?ssl=${ssl}`,
},
})
13 changes: 5 additions & 8 deletions packages/stats/core/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { Resource } from "sst/resource"
import { defineConfig } from "drizzle-kit"

// drizzle-kit drops ssl options it does not list, including mysql2's verifyIdentity, and mysql2 skips the
// hostname check without it. Options in the URL reach mysql2 unchanged.
const ssl = encodeURIComponent(JSON.stringify({ rejectUnauthorized: true, verifyIdentity: true }))

export default defineConfig({
dialect: "mysql",
schema: ["./src/database/schema.ts"],
Expand All @@ -9,13 +13,6 @@ export default defineConfig({
strict: true,
verbose: true,
dbCredentials: {
database: Resource.StatsDatabase.database,
host: Resource.StatsDatabase.host,
user: Resource.StatsDatabase.username,
password: Resource.StatsDatabase.password,
port: Resource.StatsDatabase.port,
ssl: {
rejectUnauthorized: false,
},
url: `mysql://${encodeURIComponent(Resource.StatsDatabase.username)}:${encodeURIComponent(Resource.StatsDatabase.password)}@${Resource.StatsDatabase.host}:${Resource.StatsDatabase.port}/${Resource.StatsDatabase.database}?ssl=${ssl}`,
},
})
Loading