Add JSON support for SQLite

This commit is contained in:
Pierre Burgy 2019-01-03 23:29:30 +01:00
parent 7b6558884e
commit b1f063abe0

View File

@ -134,7 +134,7 @@ module.exports = function(strapi) {
try {
// External function to map key that has been updated with `columnName`
const mapper = (params = {}) => {
if (definition.client === 'mysql') {
if (definition.client === 'mysql' || definition.client === 'sqlite3') {
Object.keys(params).map((key) => {
const attr = definition.attributes[key] || {};
@ -295,7 +295,7 @@ module.exports = function(strapi) {
});
// Convert to JSON format stringify json for mysql database
if (definition.client === 'mysql') {
if (definition.client === 'mysql' || definition.client === 'sqlite3') {
const events = [{
name: 'saved',
target: 'afterSave'