If your segemnts are broken or Mailtrain complains about missing 20190726150000_shorten_field_column_names.js, run the following in `server/setup/knex/fixes`: ```NODE_ENV=production node fix-20190726150000_shorten_field_column_names.js```
This commit is contained in:
parent
bb237b3da4
commit
ae5faadffa
3 changed files with 72 additions and 2 deletions
|
@ -8,6 +8,7 @@ const interoperableErrors = require('../../shared/interoperable-errors');
|
|||
const shares = require('./shares');
|
||||
const validators = require('../../shared/validators');
|
||||
const shortid = require('shortid');
|
||||
const slugify = require('slugify');
|
||||
const segments = require('./segments');
|
||||
const { formatDate, formatBirthday, parseDate, parseBirthday } = require('../../shared/date');
|
||||
const { getFieldColumn } = require('../../shared/lists');
|
||||
|
@ -542,7 +543,7 @@ async function createTx(tx, context, listId, entity) {
|
|||
|
||||
let columnName;
|
||||
if (!fieldType.grouped) {
|
||||
columnName = ('custom_' + '_' + shortid.generate()).toLowerCase().replace(/[^a-z0-9_]/g, '_');
|
||||
columnName = ('custom_' + slugify(entity.name, '_').substring(0, 32) + '_' + shortid.generate()).toLowerCase().replace(/[^a-z0-9_]/g, '_');
|
||||
}
|
||||
|
||||
const filteredEntity = filterObject(entity, allowedKeysCreate);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue