Skip to content
Snippets Groups Projects
Commit 6cd48a6d authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2463263 by amateescu: SQLite: Fix system\Tests\Entity\EntityDefinitionUpdateTest

parent 80f8335c
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -489,6 +489,13 @@ public function dropField($table, $field) { ...@@ -489,6 +489,13 @@ public function dropField($table, $field) {
$new_schema = $old_schema; $new_schema = $old_schema;
unset($new_schema['fields'][$field]); unset($new_schema['fields'][$field]);
// Handle possible primary key changes.
if (isset($new_schema['primary key']) && ($key = array_search($field, $new_schema['primary key'])) !== FALSE) {
unset($new_schema['primary key'][$key]);
}
// Handle possible index changes.
foreach ($new_schema['indexes'] as $index => $fields) { foreach ($new_schema['indexes'] as $index => $fields) {
foreach ($fields as $key => $field_name) { foreach ($fields as $key => $field_name) {
if ($field_name == $field) { if ($field_name == $field) {
......
...@@ -444,6 +444,11 @@ protected function assertFieldAdditionRemoval($field_spec) { ...@@ -444,6 +444,11 @@ protected function assertFieldAdditionRemoval($field_spec) {
// Clean-up. // Clean-up.
db_drop_field($table_name, 'test_field'); db_drop_field($table_name, 'test_field');
// Add back the field and then try to delete a field which is also a primary
// key.
db_add_field($table_name, 'test_field', $field_spec);
db_drop_field($table_name, 'serial_column');
db_drop_table($table_name); db_drop_table($table_name);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment