file_usage.id is type varchar_ascii but its default 0 is PHP type integer

Created on 29 August 2018, over 6 years ago
Updated 23 April 2025, 3 days ago

In core/modules/file/file.install the schema for the file_usage declares the ID field as 'varchar_ascii', but sets the default value to the number 0. If the default value should be either the string '0' or '' (empty string).

function file_schema() {
  $schema['file_usage'] = [
    'fields' => [
      ...
      'id' => [
        'description' => 'The primary key of the object using the file.',
        'type' => 'varchar_ascii',
        'length' => 64,
        'not null' => TRUE,
        'default' => 0,
      ],
      ...
    ],
  ];
}
πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component

file system

Created by

πŸ‡ΊπŸ‡ΈUnited States SocialNicheGuru

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024