You are here

function backup_migrate_schema in Backup and Migrate 6.2

Same name and namespace in other branches
  1. 8.2 backup_migrate.install \backup_migrate_schema()
  2. 8.3 backup_migrate.install \backup_migrate_schema()
  3. 6.3 backup_migrate.install \backup_migrate_schema()
  4. 7.3 backup_migrate.install \backup_migrate_schema()
  5. 7.2 backup_migrate.install \backup_migrate_schema()

Implementation of hook_schema().

File

./backup_migrate.install, line 21
Install hooks for Backup and Migrate.

Code

function backup_migrate_schema() {
  $schema['backup_migrate_profiles'] = array(
    'fields' => array(
      'profile_id' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '0',
        'description' => t('The primary identifier for a profile.'),
      ),
      'name' => array(
        'description' => t('The name of the profile.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'filename' => array(
        'description' => t('The base pattern (including unreplaced tokens) for the name of the backup file.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'append_timestamp' => array(
        'description' => t('Append a timestamp to the filename.'),
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'timestamp_format' => array(
        'description' => t('The format of the timestamp.'),
        'type' => 'varchar',
        'length' => 14,
        'not null' => TRUE,
      ),
      'filters' => array(
        'description' => t('The filter settings for the profile.'),
        'type' => 'text',
        'not null' => TRUE,
        'serialize' => TRUE,
        'serialized default' => 'a:0:{}',
      ),
    ),
    'primary key' => array(
      'profile_id',
    ),
  );
  $schema['backup_migrate_destinations'] = array(
    'fields' => array(
      'destination_id' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '0',
        'description' => t('The primary identifier for a profile.'),
      ),
      'name' => array(
        'description' => t('The name of the profile.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'type' => array(
        'description' => t('The type of the destination.'),
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
      ),
      'location' => array(
        'description' => t('The the location string of the destination.'),
        'type' => 'text',
        'not null' => TRUE,
      ),
      'settings' => array(
        'description' => t('Other settings for the destination.'),
        'type' => 'text',
        'not null' => TRUE,
        'serialize' => TRUE,
        'serialized default' => 'a:0:{}',
      ),
    ),
    'primary key' => array(
      'destination_id',
    ),
  );
  $schema['backup_migrate_schedules'] = array(
    'fields' => array(
      'schedule_id' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '0',
        'description' => t('The primary identifier for a profile.'),
      ),
      'name' => array(
        'description' => t('The name of the profile.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'source_id' => array(
        'description' => t('The {backup_migrate_destination}.destination_id of the source to backup from.'),
        'type' => 'varchar',
        'length' => 255,
        'default' => 'db',
        'not null' => TRUE,
      ),
      'destination_id' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '0',
        'description' => t('The {backup_migrate_destination}.destination_id of the destination to back up to.'),
      ),
      'profile_id' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '0',
        'description' => t('The primary identifier for a profile.'),
      ),
      'keep' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => t('The number of backups to keep.'),
      ),
      'period' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => t('The number of seconds between backups.'),
      ),
      'enabled' => array(
        'description' => t('Whether the schedule is enabled.'),
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'cron' => array(
        'description' => t('Whether the schedule should be run during cron.'),
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'schedule_id',
    ),
  );
  return $schema;
}