Обновлены миграции
Разработка парсера меню из 1с
This commit is contained in:
miroman-afk
2022-06-22 23:05:26 +03:00
parent 46cf6ff8e4
commit 9c3b633098
8 changed files with 234 additions and 14 deletions

View File

@@ -10,12 +10,12 @@ class DeleteFrontendFolders extends Migration {
* @return void
*/
public function up() {
function dirDel($dir) {
function Deldir($dir) {
$d = opendir($dir);
while (($entry = readdir($d)) !== false) {
if ($entry != "." && $entry != "..") {
if (is_dir($dir . "/" . $entry)) {
dirDel($dir . "/" . $entry);
Deldir($dir . "/" . $entry);
} else {
unlink($dir . "/" . $entry);
}
@@ -25,17 +25,17 @@ class DeleteFrontendFolders extends Migration {
rmdir($dir);
}
if (file_exists(CORE_PATH . '/../Client/web/')) {
dirDel(CORE_PATH . '/../Client/web/');
Deldir(CORE_PATH . '/../Client/web/');
} else {
Log::debug('Client frontend already deleted!');
}
if (file_exists(CORE_PATH . '/../Shift/web/')) {
dirDel(CORE_PATH . '/../Shift/web/');
Deldir(CORE_PATH . '/../Shift/web/');
} else {
Log::debug('Shift frontend already deleted!');
}
if (file_exists(CORE_PATH . '/../Report/web/')) {
dirDel(CORE_PATH . '/../Report/web/');
Deldir(CORE_PATH . '/../Report/web/');
} else {
Log::debug('Report frontend already deleted!');
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateReportCategoriesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
if (!Schema::hasTable('report_categories')) {
Schema::create('report_categories', function (Blueprint $table) {
$table->id();
$table->string('name', 255)->nullable();
$table->integer('code')->nullable();
$table->integer('is_history')->nullable();
$table->timestamps();
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::table('report_categories', function (Blueprint $table) {
//
});
}
}