Редактор карты зала
Электронные заказы
Отчет по удалениям
This commit is contained in:
miroman-afk
2022-09-22 16:34:02 +03:00
parent 1af2b267f5
commit dcd0e72d1f
43 changed files with 2481 additions and 727 deletions

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddColumnsToOrderItem extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
if (!Schema::hasColumn('order_items', 'is_deleted')) {
Schema::table('order_items', function (Blueprint $table) {
$table->tinyInteger('is_deleted')->nullable()->default(0);
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::table('order_items', function (Blueprint $table) {
$table->dropColumn('is_deleted');
});
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdateItemCountAndItemPriceInOrderItemsToFloat extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
if (!Schema::hasColumn('order_items', 'item_price')) {
Schema::table('order_items', function (Blueprint $table) {
$table->decimal('item_price', $precision = 16, $scale = 3)->nullable();
});
}
if (!Schema::hasColumn('order_items', 'item_count')) {
Schema::table('order_items', function (Blueprint $table) {
$table->decimal('item_count', $precision = 16, $scale = 2)->nullable();
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::table('order_items', function (Blueprint $table) {
$table->integer('item_price')->nullable()->change();
});
Schema::table('order_items', function (Blueprint $table) {
$table->integer('item_count')->nullable()->change();
});
}
}

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdateTotalPriceInOrdersToFloat extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
if (!Schema::hasColumn('orders', 'total_price')) {
Schema::table('orders', function (Blueprint $table) {
$table->decimal('total_price', $precision = 16, $scale = 2)->nullable();
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::table('orders', function (Blueprint $table) {
$table->integer('total_price')->nullable()->change();
});
}
}

View File

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

View File

@@ -0,0 +1,67 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePlaceTablesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (!Schema::hasTable('place_tables')) {
Schema::create('place_tables', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('place_id')->unsigned();
$table->foreign('place_id')->references('id')->on('places')->onDelete('cascade');
$table->string('name');
$table->timestamps();
});
}
if (!Schema::hasColumn('place_tables', 'table_id')) {
Schema::table('place_tables', function (Blueprint $table) {
$table->integer('table_id')->nullable();
});
}
if (!Schema::hasColumn('place_tables', 'width')) {
Schema::table('place_tables', function (Blueprint $table) {
$table->decimal('width', $precision = 10, $scale = 6)->nullable();
});
}
if (!Schema::hasColumn('place_tables', 'height')) {
Schema::table('place_tables', function (Blueprint $table) {
$table->decimal('height', $precision = 10, $scale = 6)->nullable();
});
}
if (!Schema::hasColumn('place_tables', 'x')) {
Schema::table('place_tables', function (Blueprint $table) {
$table->decimal('x', $precision = 10, $scale = 6)->nullable();
});
}
if (!Schema::hasColumn('place_tables', 'y')) {
Schema::table('place_tables', function (Blueprint $table) {
$table->decimal('y', $precision = 10, $scale = 6)->nullable();
});
}
if (!Schema::hasColumn('place_tables', 'type')) {
Schema::table('place_tables', function (Blueprint $table) {
$table->integer('type')->nullable();
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('place_tables');
}
}

View File

@@ -0,0 +1,64 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdateCoreInterface extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
function deleteFolder($dir) {
$d = opendir($dir);
while (($entry = readdir($d)) !== false) {
if ($entry != "." && $entry != "..") {
if (is_dir($dir . "/" . $entry)) {
deleteFolder($dir . "/" . $entry);
} else {
unlink($dir . "/" . $entry);
}
}
}
closedir($d);
rmdir($dir);
}
$directivesUpd = CORE_PATH . '/../V1/forUpdate/toDirectives/';
$indexUpd = CORE_PATH . '/../V1/forUpdate/toWebApp/';
if (is_dir($directivesUpd)) {
$files = array_diff(scandir($directivesUpd), array('.', '..'));
foreach ($files as $file) {
if (file_exists(CORE_PATH . '/../../web/app/scripts/directives/' . $file)) {
copy(CORE_PATH . '/../../web/app/scripts/directives/' . $file, CORE_PATH . '/../../web/app/scripts/directives/' . $file . '.bak');
}
copy($directivesUpd . $file, CORE_PATH . '/../../web/app/scripts/directives/' . $file);
}
}
if (is_dir($indexUpd)) {
$files = array_diff(scandir($indexUpd), array('.', '..'));
foreach ($files as $file) {
if (file_exists(CORE_PATH . '/../../web/app/' . $file)) {
copy(CORE_PATH . '/../../web/app/' . $file, CORE_PATH . '/../../web/app/' . $file . '.bak');
}
copy($indexUpd . $file, CORE_PATH . '/../../web/app/' . $file);
}
}
if (file_exists(CORE_PATH . '/../V1/forUpdate/')) {
deleteFolder(CORE_PATH . '/../V1/forUpdate/');
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}