30 lines
626 B
JavaScript
Raw Normal View History

2021-01-04 22:01:37 +01:00
'use strict';
const _ = require('lodash');
2021-02-15 11:24:28 +01:00
const { getService } = require('../../utils');
2021-01-04 22:01:37 +01:00
module.exports = () => {
Object.values(strapi.models).forEach(model => {
2021-02-15 11:24:28 +01:00
if (getService('content-types').isLocalized(model)) {
2021-01-04 22:01:37 +01:00
_.set(model.attributes, 'localizations', {
writable: true,
private: false,
configurable: false,
type: 'json',
});
_.set(model.attributes, 'locale', {
writable: true,
private: false,
configurable: false,
type: 'string',
});
}
});
2021-02-12 12:52:29 +01:00
strapi.db.migrations.register({
before() {},
after() {},
2021-02-12 12:52:29 +01:00
});
2021-01-04 22:01:37 +01:00
};