Generates a table name for a field data table.
When a field is a deleted, the table is renamed to {field_deleted_data_FIELD_UUID}. To make sure we don't end up with table names longer than 64 characters, we hash the uuid and return the first 10 characters so we end up with a short unique ID.
$field: The field structure.
A string containing the generated name for the database table.
function _field_sql_storage_tablename($field) {
if ($field['deleted']) {
return "field_deleted_data_" . substr(hash('sha256', $field['uuid']), 0, 10);
}
else {
return "field_data_{$field['field_name']}";
}
}