You are here

function agreement_update_7201 in Agreement 7.2

7201: Add a type column to {agreement} table.

File

./agreement.install, line 219
Install, update and uninstall functions for Agreement module.

Code

function agreement_update_7201() {
  if (!db_field_exists('agreement', 'type')) {
    db_add_field('agreement', 'type', array(
      'type' => 'varchar',
      'length' => 100,
      'not null' => TRUE,
      'default' => 'default',
    ));
  }
  if (!db_index_exists('agreement', 'type_uid')) {
    db_add_index('agreement', 'type_uid', array(
      'type',
      'uid',
    ));
  }
  if (!db_table_exists('agreement_type')) {
    $schema = agreement_schema();
    db_create_table('agreement_type', $schema['agreement_type']);
  }
  return t('Updated agreement schema and added agreement_type table.');
}