You are here

function content_synchronizer_create_tables in Content Synchronizer 8

Same name and namespace in other branches
  1. 8.2 content_synchronizer.install \content_synchronizer_create_tables()
  2. 3.x content_synchronizer.install \content_synchronizer_create_tables()

Create useful tables from schema.

1 call to content_synchronizer_create_tables()
content_synchronizer_install in ./content_synchronizer.install
Implements hook_install().

File

./content_synchronizer.install, line 74
Installation hooks for content_synchronizer module.

Code

function content_synchronizer_create_tables() {
  foreach (content_synchronizer_get_schema() as $table => $definition) {
    try {
      \Drupal::database()
        ->schema()
        ->createTable($table, $definition);
    } catch (\Exception $e) {
      echo $e
        ->getMessage();
    }
  }
}