Skip to content

Instantly share code, notes, and snippets.

@wojtha
Created April 9, 2011 20:22
Show Gist options
  • Save wojtha/911735 to your computer and use it in GitHub Desktop.
Save wojtha/911735 to your computer and use it in GitHub Desktop.
Snippet how to recreate table using Drupal Schema API
<?php
$module = 'my_module';
$table = 'my_table';
$ret = array();
db_drop_table($ret, $table);
$schema = drupal_get_schema_unprocessed($module);
db_create_table($ret, $table, $schema[$table]);
dpm($ret); // print return values - queries and success state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment