Drupal 7: Create a datetime field in a schema with db_create_table

To create a table in Drupal 7, you can use the “my_module_update_7000” hook in the “my_module.install” file. The datetime type is unfortunately not mapped, which is why you have to use the “mysql_type” key const MY_MODULE_TABLE_NAME = ‘my_module_table’; function get_my_module_schema(): array { return [ ‘description’ => ‘description’, ‘fields’ => [ ‘id’ => [‘type’ => ‘serial’, … Read more

Install drupal/console on drupal 9

MacBook avec code sur un bureau

The drupal/console package was never made fully compatible with Drupal 9, and its development has now stopped. If you are starting a recent project, the command-line reference is now Drush. The modern solution: Drush Drush is actively maintained and compatible with Drupal 9, 10 and beyond: composer require drush/drush You then access the commands through … Read more