You are here

function backup_migrate_schema in Backup and Migrate 8.2

Same name and namespace in other branches
  1. 8.3 backup_migrate.install \backup_migrate_schema()
  2. 6.3 backup_migrate.install \backup_migrate_schema()
  3. 6.2 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' => 32,
        'not null' => TRUE,
        'default' => '0',
        'description' => 'The primary identifier for a profile.',
      ),
      'name' => array(
        'description' => 'The name of the profile.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'filename' => array(
        'description' => 'The name of the profile.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'append_timestamp' => array(
        'description' => 'Append a timestamp to the filename.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'timestamp_format' => array(
        'description' => 'The format of the timestamp.',
        'type' => 'varchar',
        'length' => 14,
        'not null' => TRUE,
      ),
      'filters' => array(
        'description' => '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' => 32,
        'not null' => TRUE,
        'default' => '0',
        'description' => 'The primary identifier for a profile.',
      ),
      'name' => array(
        'description' => 'The name of the profile.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'type' => array(
        'description' => 'The type of the destination.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
      ),
      'location' => array(
        'description' => 'The the location string of the destination.',
        'type' => 'text',
        'not null' => TRUE,
      ),
      'settings' => array(
        'description' => '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' => 32,
        'not null' => TRUE,
        'default' => '0',
        'description' => 'The primary identifier for a profile.',
      ),
      'name' => array(
        'description' => 'The name of the profile.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'source_id' => array(
        'description' => 'The {backup_migrate_destination}.destination_id of the source to backup from.',
        'type' => 'varchar',
        'length' => 32,
        'default' => 'db',
        'not null' => TRUE,
      ),
      'destination_id' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '0',
        'description' => 'The {backup_migrate_destination}.destination_id of the destination to back up to.',
      ),
      'profile_id' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '0',
        'description' => 'The primary identifier for a profile.',
      ),
      'keep' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The number of backups to keep.',
      ),
      'period' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The number of seconds between backups.',
      ),
      'enabled' => array(
        'description' => 'Whether the schedule is enabled.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'cron' => array(
        'description' => '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;
}