FOSSology  4.4.0
Open Source License Compliance by Open Source Software
dbmigrate_3.5-3.6.php File Reference

Migrate DB from release 3.5.0 to 3.6.0 with new column for decision tables. More...

Go to the source code of this file.

Functions

 calculateNumberOfRecordsToBeProcessed ($dbManager, $tableName, $columnName)
 calculate number of records and return offset More...
 
 cleanDecisionTable ($dbManager, $tableName)
 Removes duplicate decisions based on same textfinding for same pfile. More...
 
 updateHash ($dbManager, $tableName)
 Update the hash column of the table with value from textfinding. More...
 
 updateSHA256 ($dbManager, $tableName)
 Update the sha256 column of the table with value from textfinding. More...
 
 isColumnUpperCase ($dbManager, $tableName, $colName, $where)
 Check if the given column contains only upper case entries. More...
 
 updatePfileSha256 ($dbManager, $force=false)
 
 migrate_35_36 ($dbManager, $force=false)
 

Detailed Description

Migrate DB from release 3.5.0 to 3.6.0 with new column for decision tables.

Definition in file dbmigrate_3.5-3.6.php.

Function Documentation

◆ calculateNumberOfRecordsToBeProcessed()

calculateNumberOfRecordsToBeProcessed (   $dbManager,
  $tableName,
  $columnName 
)

calculate number of records and return offset

The function gets count of the values from database and check if there are more than 10,000 records then return 10,000, otherwise return number of records.

Parameters
DbManager$dbManager
string$tableName

Definition at line 27 of file dbmigrate_3.5-3.6.php.

◆ cleanDecisionTable()

cleanDecisionTable (   $dbManager,
  $tableName 
)

Removes duplicate decisions based on same textfinding for same pfile.

The function first tries to remove all duplicate decisions from deactivated list then from active list.

Parameters
DbManager$dbManager
string$tableName

Definition at line 49 of file dbmigrate_3.5-3.6.php.

◆ isColumnUpperCase()

isColumnUpperCase (   $dbManager,
  $tableName,
  $colName,
  $where 
)

Check if the given column contains only upper case entries.

Parameters
$dbManagerDbManager
$tableNameTable to check
$colNameColumn of the table to check
$whereAdditional where clause conditions

Definition at line 208 of file dbmigrate_3.5-3.6.php.

◆ migrate_35_36()

migrate_35_36 (   $dbManager,
  $force = false 
)

Migration from FOSSology 3.5.0 to 3.6.0

Parameters
DbManager$dbManager
boolean$forceSet true to force run the script.

Definition at line 290 of file dbmigrate_3.5-3.6.php.

◆ updateHash()

updateHash (   $dbManager,
  $tableName 
)

Update the hash column of the table with value from textfinding.

Parameters
DbManager$dbManager
string$tableName
Returns
integer Number of entries updated

Definition at line 92 of file dbmigrate_3.5-3.6.php.

◆ updateSHA256()

updateSHA256 (   $dbManager,
  $tableName 
)

Update the sha256 column of the table with value from textfinding.

Parameters
DbManager$dbManager
string$tableName
Returns
integer Number of entries updated

Definition at line 140 of file dbmigrate_3.5-3.6.php.