Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The createFieldSql() function is present in all the Schema() child class (mysql, pgsql and sqlite) and have the same doc comment, but there is not a function definition in the parent class like the dropTable(), renameTable() and other functions.
Proposed resolution
Create an abstract function definition in the parent class and update the doc comment.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#2 | add_the_createfieldsql_function_definition_in_the_schema_parent_class-2864197-2.patch | 3.42 KB | adriancid |
Comments
Comment #2
adriancidComment #3
markdorisonThis change makes sense in the context that you have provided as there are no other core extensions of the
DatabaseSchema
parent class wherecreateFieldSql()
is not present. It seems like there are three possibilities:DatabaseSchema
in core that did not need to implementcreateFieldSql()
.Assuming the answer is not option #3, then I think this change is good and the patch is RTBC.
Comment #4
alexpottI don't think this change is correct. This method just happens to be called the same in all three concrete implementations. If we implement on the abstract class all custom/drivers db drivers have to implement this method even if their implementations don't need it. Basically nothing protected needs to be on the abstract class if it is not called from the abstract class itself.