upgrade 6.0 changes
This commit is contained in:
@@ -215,6 +215,10 @@ class Diff
|
||||
fs.mkdirSync(upgradePath + '/files');
|
||||
}
|
||||
|
||||
if (fs.existsSync(upgradeDataFolderPath + '/beforeUpgradeFiles')) {
|
||||
cp.execSync('cp -r ' + upgradeDataFolderPath + '/beforeUpgradeFiles ' + upgradePath + '/beforeUpgradeFiles');
|
||||
}
|
||||
|
||||
if (beforeUpgradeFileList.length) {
|
||||
if (!fs.existsSync(upgradePath + '/beforeUpgradeFiles')) {
|
||||
fs.mkdirSync(upgradePath + '/beforeUpgradeFiles');
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"fields": {
|
||||
"entityType": {
|
||||
"type": "varchar",
|
||||
"index": true,
|
||||
"maxLength": 100
|
||||
},
|
||||
"fieldName": {
|
||||
"type": "varchar",
|
||||
"maxLength": 100
|
||||
},
|
||||
"value": {
|
||||
"type": "int",
|
||||
"default": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,6 +36,8 @@ class BeforeUpgrade
|
||||
$this->container = $container;
|
||||
|
||||
$this->processMyIsamCheck();
|
||||
|
||||
$this->processNextNumberAlterTable();
|
||||
}
|
||||
|
||||
protected function processMyIsamCheck()
|
||||
@@ -73,7 +75,6 @@ class BeforeUpgrade
|
||||
$databaseInfo = $container->get('config')->get('database');
|
||||
|
||||
try {
|
||||
|
||||
$sth = $pdo->prepare("
|
||||
SELECT TABLE_NAME as tableName
|
||||
FROM information_schema.TABLES
|
||||
@@ -82,8 +83,8 @@ class BeforeUpgrade
|
||||
");
|
||||
|
||||
$sth->execute();
|
||||
|
||||
}catch (Exception $e) {
|
||||
}
|
||||
catch (Exception $e) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -95,4 +96,15 @@ class BeforeUpgrade
|
||||
|
||||
return $tableList;
|
||||
}
|
||||
|
||||
protected function processNextNumberAlterTable()
|
||||
{
|
||||
$pdo = $this->container->get('entityManager')->getPDO();
|
||||
|
||||
$q1 = "ALTER TABLE `next_number` CHANGE `entity_type` `entity_type` VARCHAR(100)";
|
||||
$q2 = "ALTER TABLE `next_number` CHANGE `field_name` `field_name` VARCHAR(100)";
|
||||
|
||||
$pdo->exec($q1);
|
||||
$pdo->exec($q2);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user