You are here

function forena_update_7202 in Forena Reports 7.3

Same name and namespace in other branches
  1. 7.2 forena.install \forena_update_7202()

Add language column

File

./forena.install, line 110
Installation api for module

Code

function forena_update_7202() {
  if (!db_field_exists('forena_reports', 'language')) {
    db_add_field('forena_reports', 'language', array(
      'type' => 'varchar',
      'length' => 30,
      'not null' => TRUE,
      'default' => 'en',
    ));
    db_query("update {forena_reports} set language='en'");
    db_drop_primary_key('forena_reports');
    db_add_primary_key('forena_reports', array(
      'report_name',
      'language',
    ));
  }
}