I'm getting following error when trying to create custom field.
There was a problem creating field Signature: Exception thrown while performing a schema update. SQLSTATE[42000]: Syntax error or access violation: 1170 BLOB/TEXT column 'field_signature_value' used in key specification without a key length: CREATE TABLE {node__field_signature} ( `bundle` VARCHAR(128) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance', `deleted` TINYINT NOT NULL DEFAULT 0 COMMENT 'A boolean indicating whether this data item has been deleted', `entity_id` INT unsigned NOT NULL COMMENT 'The entity id this data is attached to', `revision_id` INT unsigned NOT NULL COMMENT 'The entity revision id this data is attached to', `langcode` VARCHAR(32) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '' COMMENT 'The language code for this data item.', `delta` INT unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields', `field_signature_value` LONGBLOB NULL DEFAULT NULL COMMENT 'base64 value of signature image', PRIMARY KEY (`entity_id`, `deleted`, `delta`, `langcode`), INDEX `bundle` (`bundle`), INDEX `revision_id` (`revision_id`), INDEX `field_signature_value` (`field_signature_value`) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT 'Data storage for node field field_signature.'; Array ( )
As my understand I need to mention length for the key value. But how could I mention length for blob field?
/**
* {@inheritdoc}
*/
public static function schema(FieldStorageDefinitionInterface $field_definition) {
return array(
'columns' => array(
'value' => array(
'type' => 'blob',
'size' => 'big',
'not null' => FALSE,
'description' => 'base64 value of signature image',
),
),
'indexes' => array(
'value' => array('value'),
),
);
}
Comments
Comment #2
ARUN AK CreditAttribution: ARUN AK commentedComment #7
cilefen CreditAttribution: cilefen commentedI am closing this support request because there have been no recent comments.
The Drupal Core issue queue is not the ideal place for support requests. Consider other sources of support.