FOSSology  4.4.0
Open Source License Compliance by Open Source Software
dbmigrate_bulk_license.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2015 Siemens AG
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
17 $rf_fkExists = $dbManager->existsColumn("license_ref_bulk", "rf_fk");
18 $removingExists = $dbManager->existsColumn("license_ref_bulk", "removing");
19 
20 if ($rf_fkExists && $removingExists) {
21  echo "Transform bulk licenses into bulk license sets...";
22  $dbManager->queryOnce('
23  INSERT INTO license_set_bulk (lrb_fk, rf_fk, removing)
24  SELECT lrb_pk lrb_fk, rf_fk, removing FROM license_ref_bulk');
25  echo "...and drop the old columns\n";
26  $libschema->dropColumnsFromTable(array('rf_fk', 'removing'), 'license_ref_bulk');
27 }