示例#1
0
 /**
  * Create Schema for this test if not yet done
  *
  * @param WorkflowOptions $options
  */
 public static function createSchema(WorkflowOptions $options)
 {
     $conn = self::getConnection();
     if (!isset(self::$schema[$options->getTablePrefix()])) {
         $schemaBuilder = new SchemaBuilder($conn);
         try {
             $schemaBuilder->dropWorkflowSchema($options);
         } catch (\PDOException $e) {
         }
         $schemaBuilder->createWorkflowSchema($options);
         self::$schema[$options->getTablePrefix()] = true;
     }
     $platform = $conn->getDatabasePlatform();
     $tables = array($options->executionStateTable(), $options->executionTable(), $options->variableHandlerTable(), $options->nodeConnectionTable(), $options->nodeTable(), $options->workflowTable());
     foreach ($tables as $table) {
         $conn->executeUpdate($platform->getTruncateTableSQL($table));
     }
 }