Skip to content

Instantly share code, notes, and snippets.

@DavidHernandez
Created September 22, 2014 10:40
Show Gist options
  • Select an option

  • Save DavidHernandez/b71b27c4170ac65e5a5a to your computer and use it in GitHub Desktop.

Select an option

Save DavidHernandez/b71b27c4170ac65e5a5a to your computer and use it in GitHub Desktop.
A little script to install some Drupal tables. It could be a drush command, but I'm feeling lazy...
<?php
// Module name
$module = '';
// List of tables to install
$tables = array('');
$schemas = drupal_get_schema_unprocessed($module);
foreach ($schemas as $key => $schema) {
if (!in_array($key, $tables)) {
unset($schemas[$key]);
}
}
_drupal_schema_initialize($schemas, $module, FALSE);
foreach ($schemas as $name => $table) {
db_create_table($name, $table);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment