Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

Drupal - Must new tables be created in hook_update_N()?

So just a copy paste from drupal.org. You also need to add the schema definition to hook_schema.

/**
 * Create new database table {mytable2}.
 */
function mymodule_update_7101() {
  $schema['mytable2'] = array(
     // table definition array goes here
  );
  db_create_table('mytable2', $schema['mytable2']);
}

Tags:

Database

Updating

Related

Drupal - How can I upload 1000s of nodes per hour to a live drupal 7 site and avoid deadlocks? Drupal - When should "'target' => 'slave'" be used in a query? Drupal - How can I quickly re-save all the nodes on my site (to trigger a rule that activates on content update)? Drupal - Get the latitude and longitude from the user ip Drupal - How can I detect if the current viewed page is administrative? Drupal - Remove subject field from comments Drupal - The PHP version is not correctly detected Drupal - Character limit of field machine name? Drupal - Clear Cache without logging in Drupal - How to remove core search index? Drupal - Unable to send e-mail via sendmail, because User is unknown Drupal - List of all active modules used in a site

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy