Common functionalities

This commit is contained in:
ahwelp
2023-01-24 20:35:43 +00:00
parent 1012e09995
commit d821c32013
43 changed files with 1278 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
<?php
use Schema\Wrapper as Wrapper;
use App\Core\Sanity\MigratorController as Migrator;
function common_files_upgrade($pluginversion) {
if ($pluginversion < "0.0.1") {
$table = Wrapper::get_table("common_filess");
$table->addColumn("name", "string", Array("null" => false));
$table->addColumn("time", "timestamp", Array("null" => true, "default"=>null));
$table->addColumn("areaid", "integer", Array("null" => false));
$table->addTimestamps();
$table->addSoftDelete();
$table->create();
Migrator::getInstance()->update_plugin_version("common_files", "1.0.0");
return;
}
//if ($pluginversion < "0.0.2") {
//$table = Wrapper::get_table("common_filess");
//Migrator::getInstance()->update_plugin_version("common_files", "1.0.1");
//return;
//}
}
function common_files_rollback($pluginversion) {
if($pluginversion > "0.0.1"){
$table = Wrapper::get_table("common_filess");
$table->drop();
return;
}
}