mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
Fix JSON field for postgres when the value is a simple string
This commit is contained in:
parent
17a7845e3d
commit
52bcdad90b
@ -16,11 +16,18 @@ class PostgresDialect extends Dialect {
|
||||
}
|
||||
|
||||
async initialize() {
|
||||
// Don't cast DATE string to Date()
|
||||
this.db.connection.client.driver.types.setTypeParser(
|
||||
this.db.connection.client.driver.types.builtins.DATE,
|
||||
'text',
|
||||
(v) => v
|
||||
); // Don't cast DATE string to Date()
|
||||
);
|
||||
// Don't parse JSONB automatically
|
||||
this.db.connection.client.driver.types.setTypeParser(
|
||||
this.db.connection.client.driver.types.builtins.JSONB,
|
||||
'text',
|
||||
(v) => v
|
||||
);
|
||||
this.db.connection.client.driver.types.setTypeParser(
|
||||
this.db.connection.client.driver.types.builtins.NUMERIC,
|
||||
'text',
|
||||
|
Loading…
x
Reference in New Issue
Block a user