|
|
@ -69,17 +69,21 @@ export async function columnAdd( |
|
|
|
|
|
|
|
|
|
|
|
const project = await base.getProject(); |
|
|
|
const project = await base.getProject(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (req.body.title || req.body.column_name) { |
|
|
|
const dbDriver = NcConnectionMgrv2.get(base); |
|
|
|
const dbDriver = NcConnectionMgrv2.get(base); |
|
|
|
|
|
|
|
|
|
|
|
const sqlClientType = dbDriver.clientType(); |
|
|
|
const sqlClientType = dbDriver.clientType(); |
|
|
|
|
|
|
|
|
|
|
|
const mxColumnLength = Column.getMaxColumnNameLength(sqlClientType); |
|
|
|
const mxColumnLength = Column.getMaxColumnNameLength(sqlClientType); |
|
|
|
|
|
|
|
|
|
|
|
if (req.body.column_name.length > mxColumnLength) { |
|
|
|
if ((req.body.title || req.body.column_name).length > mxColumnLength) { |
|
|
|
NcError.badRequest( |
|
|
|
NcError.badRequest( |
|
|
|
`Column name ${req.body.column_name} exceeds ${mxColumnLength} characters` |
|
|
|
`Column name ${ |
|
|
|
|
|
|
|
req.body.title || req.body.column_name |
|
|
|
|
|
|
|
} exceeds ${mxColumnLength} characters` |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
if ( |
|
|
|
!isVirtualCol(req.body) && |
|
|
|
!isVirtualCol(req.body) && |
|
|
|