function backup_migrate_schema in Backup and Migrate 7.3
Same name and namespace in other branches
- 8.2 backup_migrate.install \backup_migrate_schema()
- 8.3 backup_migrate.install \backup_migrate_schema()
- 6.3 backup_migrate.install \backup_migrate_schema()
- 6.2 backup_migrate.install \backup_migrate_schema()
- 7.2 backup_migrate.install \backup_migrate_schema()
Implements hook_schema().
File
- ./
backup_migrate.install, line 138 - Install hooks for Backup and Migrate.
Code
function backup_migrate_schema() {
$schema['backup_migrate_profiles'] = array(
'export' => array(
'key' => 'machine_name',
'key name' => 'Profile ID',
'admin_title' => 'name',
'primary key' => 'profile_id',
// Exports will be defined as $preset.
'identifier' => 'item',
// Function hook name.
'default hook' => 'exportables_backup_migrate_profiles',
'api' => array(
'owner' => 'backup_migrate',
// Base name for api include files.
'api' => 'backup_migrate_exportables',
'minimum_version' => 1,
'current_version' => 1,
),
),
'fields' => array(
'profile_id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
// Do not export database-only keys.
'no export' => TRUE,
),
'machine_name' => array(
'type' => 'varchar',
'length' => 255,
'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',
'size' => 'medium',
'not null' => TRUE,
'serialize' => TRUE,
'serialized default' => 'a:0:{}',
),
),
'primary key' => array(
'profile_id',
),
);
$schema['backup_migrate_destinations'] = array(
'export' => array(
'key' => 'machine_name',
'key name' => 'Destination ID',
'admin_title' => 'name',
'primary key' => 'destination_id',
// Exports will be defined as $preset.
'identifier' => 'item',
// Function hook name.
'default hook' => 'exportables_backup_migrate_destinations',
'api' => array(
'owner' => 'backup_migrate',
// Base name for api include files.
'api' => 'backup_migrate_exportables',
'minimum_version' => 1,
'current_version' => 1,
),
),
'fields' => array(
'destination_id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
// Do not export database-only keys.
'no export' => TRUE,
),
'machine_name' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '0',
'description' => 'The primary identifier for a destination.',
),
'name' => array(
'description' => 'The name of the destination.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'subtype' => 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_sources'] = array(
'export' => array(
'key' => 'machine_name',
'key name' => 'Source ID',
'admin_title' => 'name',
'primary key' => 'source_id',
// Exports will be defined as $preset.
'identifier' => 'item',
// Function hook name.
'default hook' => 'exportables_backup_migrate_sources',
'api' => array(
'owner' => 'backup_migrate',
// Base name for api include files.
'api' => 'backup_migrate_exportables',
'minimum_version' => 1,
'current_version' => 1,
),
),
'fields' => array(
'source_id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
// Do not export database-only keys.
'no export' => TRUE,
),
'machine_name' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '0',
'description' => 'The primary identifier for a source.',
),
'name' => array(
'description' => 'The name of the source.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'subtype' => array(
'description' => 'The type of the source.',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
),
'location' => array(
'description' => 'The the location string of the source.',
'type' => 'text',
'not null' => TRUE,
),
'settings' => array(
'description' => 'Other settings for the source.',
'type' => 'text',
'not null' => TRUE,
'serialize' => TRUE,
'serialized default' => 'a:0:{}',
),
),
'primary key' => array(
'source_id',
),
);
$schema['backup_migrate_schedules'] = array(
'export' => array(
'key' => 'machine_name',
'key name' => 'Source ID',
'admin_title' => 'name',
'primary key' => 'schedule_id',
// Exports will be defined as $preset.
'identifier' => 'item',
// Function hook name.
'default hook' => 'exportables_backup_migrate_schedules',
'api' => array(
'owner' => 'backup_migrate',
// Base name for api include files.
'api' => 'backup_migrate_exportables',
'minimum_version' => 1,
'current_version' => 1,
),
),
'fields' => array(
'schedule_id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
// Do not export database-only keys.
'no export' => TRUE,
),
'machine_name' => array(
'type' => 'varchar',
'length' => 255,
'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' => 255,
'default' => 'db',
'not null' => TRUE,
),
'destination_id' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '0',
'description' => 'The {backup_migrate_destination}.destination_id of the destination to back up to.',
),
'copy_destination_id' => array(
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '0',
'description' => 'A second {backup_migrate_destination}.destination_id of the destination to copy the backup to.',
),
'profile_id' => array(
'type' => 'varchar',
'length' => 255,
'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' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => 'builtin',
),
'cron_schedule' => array(
'description' => 'The cron schedule to run on.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '0 4 * * *',
),
),
'primary key' => array(
'schedule_id',
),
);
return $schema;
}