In my module I am using
hook_schema() to create an empty (custom) DB table when the module is installed. However, there are some use cases where the module would need to be installed when the table already exists. This gives the following error:
Drupal\Core\Database\SchemaObjectExistsException: Table example_table already exists. in Drupal\Core\Database\Schema->createTable() (line 594 of [PATH]\core\lib\Drupal\Core\Database\Schema.php).
It looks like the module is still installed, but the error likely means that future install logic might not be executed.
Is it possible to perform the schema logic only if the table does not exist, or some other way to ignore the table if it exists?