Skip to content
Snippets Groups Projects

Issue #3080420: SQLSTATE[HY000]: General error: 1 near "-": syntax error

Merged Issue #3080420: SQLSTATE[HY000]: General error: 1 near "-": syntax error
All threads resolved!
All threads resolved!
+ 28
1
@@ -38,7 +38,7 @@ function restrict_ip_schema() {
],
],
'indexes' => [
'type-path' => ['type', 'path'],
'type_path' => ['type', 'path'],
],
];
@@ -84,3 +84,30 @@ function restrict_ip_update_8001() {
],
]);
}
/**
* Adjust index name for database compatibilities.
*/
function restrict_ip_update_8002() {
\Drupal::database()->schema()->dropIndex('restrict_ip_paths', 'type-path');
\Drupal::database()->schema()->addIndex('restrict_ip_paths', 'type_path', [
'type',
'path',
],
// The old table specification (unfortunately this is still needed by this
// method):
[
'fields' => [
'type' => [
'description' => 'The type of the listing, either black or white',
'type' => 'varchar',
'length' => 5,
],
'path' => [
'description' => 'The path to be white/blacklisted',
'type' => 'varchar',
'length' => 255,
],
],
]);
}
Loading