|
Tripal
|


Public Member Functions | |
| setTripalJob (TripalJob $job) | |
| setInstallID (int $install_id) | |
| lookupInstallID () | |
| reportMigrationStatus (object $migration, bool $status) | |
| checkMigrationStatus () | |
| validateParameters () | |
| performTask () | |
| getProgress () | |
| getStatus () | |
Public Member Functions inherited from Drupal\tripal_chado\Task\ChadoTaskBase | |
| getTripalDbxClass ($class) | |
Public Member Functions inherited from Drupal\tripal_biodb\Task\BioTaskBase | |
| __construct (?Connection $database=NULL, ?LoggerInterface $logger=NULL, ?SharedLockBackendInterface $locker=NULL, ?StateInterface $state=NULL,) | |
| setParameters (array $parameters=[]) | |
| getId () | |
| getLogger () | |
Static Public Member Functions | |
| static | runTripalJob (string $schema_name, int $install_id, TripalJob $job) |
| static | getHighestVersion () |
| static | getAvailableMigrations () |
Public Attributes | |
| const | TASK_NAME = 'apply_migrations' |
| const | BASELINE_CHADO_VERSION = '1.3' |
| const | MIGRATIONS_INFO_YAML = '/chado_schema/migrations/tripal_chado.chado_migrations.yml' |
| const | MIGRATION_DIR = '/chado_schema/migrations/' |
| array | $migration_status = [] |
| ChadoConnection | $chado_connection |
| $drupal_connection | |
Public Attributes inherited from Drupal\tripal_chado\Task\ChadoTaskBase | |
| const | TASK_NAME = 'chado' |
Public Attributes inherited from Drupal\tripal_biodb\Task\BioTaskBase | |
| const | TASK_NAME = 'task' |
| const | STATE_KEY_DATA_PREFIX = 'tripal_biodb_' |
Protected Attributes | |
| TripalJob | $job |
| int | $job_id = 0 |
| int | $install_id |
| int | $version_cvterm_id |
Protected Attributes inherited from Drupal\tripal_biodb\Task\BioTaskBase | |
| $id | |
| $connection | |
| $logger | |
| $locker | |
| $state | |
| $parameters = ['input_schemas' => [], 'output_schemas' => []] | |
| $inputSchemas = [] | |
| $outputSchemas = [] | |
Additional Inherited Members | |
Protected Member Functions inherited from Drupal\tripal_biodb\Task\BioTaskBase | |
| prepareSchemas (array $schema_list) | |
| getSchemaLockName (TripalDbxConnection $db,) | |
| initId () | |
| acquireTaskLocks () | |
| releaseTaskLocks () | |
Applies Chado Migrations usually handled by Flyway.
Usage:
| Drupal\tripal_chado\Task\ChadoApplyMigrations::checkMigrationStatus | ( | ) |
Checks the status of this schema. Specifically, which migrations have been applied and which are still pending.
|
static |
Gets details for all the current migrations available.
|
static |
Gets the highest version number available in our migrations.
| Drupal\tripal_chado\Task\ChadoApplyMigrations::getProgress | ( | ) |
{Returns the percent of progress of current task.This method can also be used to check if a task is currently running if it has a > 0 value. A negative value means an error occured while running.
Implements Drupal\tripal_biodb\Task\BioTaskInterface.
| Drupal\tripal_chado\Task\ChadoApplyMigrations::getStatus | ( | ) |
{{Returns a string describing current status of the performed task.This function returns the last known status, even if the task ended. In case of failure, this function may return the reason of the failure.
Reimplemented from Drupal\tripal_biodb\Task\BioTaskBase.
| Drupal\tripal_chado\Task\ChadoApplyMigrations::lookupInstallID | ( | ) |
Lookup the install ID based on the input schema name.
| Drupal\tripal_chado\Task\ChadoApplyMigrations::performTask | ( | ) |
Applies all outstanding migrations to a given chado instance.
The migration procedure uses a set of SQL files where each migration is in it's own file.
Task parameter array provided to the class constructor includes:
Example:
| Drupal |
tripal_biodb\Exception\TaskException Thrown when a major failure prevents the task from being performed.
Drupal\tripal_biodb\Exception\ParameterException Thrown if parameters are incorrect.
| Drupal |
tripal_biodb\Exception\LockException Thrown when the locks can't be acquired.
Reimplemented from Drupal\tripal_biodb\Task\BioTaskBase.
| Drupal\tripal_chado\Task\ChadoApplyMigrations::reportMigrationStatus | ( | object | $migration, |
| bool | $status | ||
| ) |
Saves the status of the current migration to the database.
| object | $migration |
|
| bool | $status |
|
static |
A callable function to provide to tripal jobs as the callback.
Simply sets up the biotask with the details saved in the job and then performs the task.
| string | $schema_name | The schema to apply all pending migrations to. |
| int | $install_id | The unique IF od the Tripal-managed chado installation the schema represents. |
| Drupal\tripal_chado\Task\ChadoApplyMigrations::setInstallID | ( | int | $install_id | ) |
Sets the unique id of the Tripal-managed chado installation this biotask is focused on.
| int | $install_id |
| Drupal\tripal_chado\Task\ChadoApplyMigrations::setTripalJob | ( | TripalJob | $job | ) |
Sets the Tripal job that the migrations are being applied during.
| TripalJob | $job |
| Drupal\tripal_chado\Task\ChadoApplyMigrations::validateParameters | ( | ) |
Validate task parameters.
Parameter array provided to the class constructor must include one output schema:
Drupal\tripal_biodb\Exception\ParameterException A descriptive exception is thrown in case of invalid parameters.
Implements Drupal\tripal_biodb\Task\BioTaskInterface.