Update migrations
This commit is contained in:
miroman-afk
2022-01-14 14:24:19 +03:00
parent 61d8b4e1d2
commit 104017ed96
10 changed files with 95 additions and 62 deletions

View File

@@ -171,10 +171,11 @@ class POSTRestoreShift extends HRCCommand implements HRCCommandInterface {
$shift_online_deleted_item->units_id = $exchange_deleted_item["units_id"];
$shift_online_deleted_item->save();
}
$exc_time = time();
$diff_time = $exc_time - $nowTime;
return [
'status' => 'success',
'message' => 'Смена восстановлена',
'message' => 'Смена восстановлена за ' . $diff_time . ' сек',
];
} else {
return [

View File

@@ -11,16 +11,18 @@ class CreateTableSubscribers extends Migration {
* @return void
*/
public function up() {
Schema::create('subscribers', function (Blueprint $table) {
$table->id();
$table->string('code')->nullable();
$table->string('destination_module')->nullable();
$table->string('destination_method')->nullable();
$table->string('source_module')->nullable();
$table->string('source_method')->nullable();
$table->integer('weight')->nullable();
$table->timestamps();
});
if (!Schema::hasTable('subscribers')) {
Schema::create('subscribers', function (Blueprint $table) {
$table->id();
$table->string('code')->nullable();
$table->string('destination_module')->nullable();
$table->string('destination_method')->nullable();
$table->string('source_module')->nullable();
$table->string('source_method')->nullable();
$table->integer('weight')->nullable();
$table->timestamps();
});
}
}
/**

View File

@@ -10,9 +10,11 @@ class AddValueToExchangeActionsTable extends Migration {
* @return void
*/
public function up() {
Schema::table('exchange_actions', function (Blueprint $table) {
$table->string('value', 255)->nullable()->change();
});
if (!Schema::hasColumn('exchange_actions', 'value')) {
Schema::table('exchange_actions', function (Blueprint $table) {
$table->string('value', 255)->nullable()->change();
});
}
}
/**

View File

@@ -13,8 +13,8 @@ class AddForeignKeyToClientsTable extends Migration {
Schema::table('clients', function (Blueprint $table) {
$table->string('user_code')->unique()->change();
});
}
/**

View File

@@ -11,16 +11,18 @@ class CreateClientsBarcodesTable extends Migration {
* @return void
*/
public function up() {
Schema::create('clients_barcodes', function (Blueprint $table) {
$table->id();
$table->string('client_guid');
$table->string('code_id');
$table->string('name');
$table->string('block');
$table->string('value');
$table->string('symptom_block');
$table->timestamps();
});
if (!Schema::hasTable('clients_barcodes')) {
Schema::create('clients_barcodes', function (Blueprint $table) {
$table->id();
$table->string('client_guid');
$table->string('code_id');
$table->string('name');
$table->string('block');
$table->string('value');
$table->string('symptom_block');
$table->timestamps();
});
}
}
/**

View File

@@ -11,17 +11,19 @@ class CreateOrdersTable extends Migration {
* @return void
*/
public function up() {
Schema::create('orders', function (Blueprint $table) {
$table->id();
$table->integer('total_count')->nullable();
$table->integer('total_price')->nullable();
$table->integer('staff_id');
$table->string('client_id')->nullable();
$table->integer('is_send');
$table->integer('is_delivery')->nullable();
$table->integer('is_pickup')->nullable();
$table->timestamps();
});
if (!Schema::hasTable('orders')) {
Schema::create('orders', function (Blueprint $table) {
$table->id();
$table->integer('total_count')->nullable();
$table->integer('total_price')->nullable();
$table->integer('staff_id');
$table->string('client_id')->nullable();
$table->integer('is_send');
$table->integer('is_delivery')->nullable();
$table->integer('is_pickup')->nullable();
$table->timestamps();
});
}
}
/**

View File

@@ -11,17 +11,19 @@ class CreateOrderItemsTable extends Migration {
* @return void
*/
public function up() {
Schema::create('order_items', function (Blueprint $table) {
$table->id();
$table->integer('order_id');
$table->integer('item_id');
$table->integer('modifier_id')->nullable();
$table->integer('parent_id')->nullable();
$table->integer('item_count');
$table->integer('item_price');
$table->integer('staff_id');
$table->timestamps();
});
if (!Schema::hasTable('order_items')) {
Schema::create('order_items', function (Blueprint $table) {
$table->id();
$table->integer('order_id');
$table->integer('item_id');
$table->integer('modifier_id')->nullable();
$table->integer('parent_id')->nullable();
$table->integer('item_count');
$table->integer('item_price');
$table->integer('staff_id');
$table->timestamps();
});
}
}
/**

View File

@@ -12,24 +12,44 @@ class AddColumnsToShiftOnlineOrders extends Migration {
*/
public function up() {
Schema::table('shift_online_orders', function (Blueprint $table) {
$table->integer('is_self')->nullable();
$table->integer('is_block')->nullable();
$table->integer('is_edit')->nullable();
$table->string('guid')->nullable();
if (!Schema::hasColumn('shift_online_orders', 'is_self')) {
$table->integer('is_self')->nullable();
}
if (!Schema::hasColumn('shift_online_orders', 'is_block')) {
$table->integer('is_block')->nullable();
}
if (!Schema::hasColumn('shift_online_orders', 'is_edit')) {
$table->integer('is_edit')->nullable();
}
if (!Schema::hasColumn('shift_online_orders', 'guid')) {
$table->string('guid')->nullable();
}
});
Schema::table('shift_online_items', function (Blueprint $table) {
$table->decimal('count_real', $precision = 16, $scale = 2)->nullable();
$table->decimal('count_return', $precision = 16, $scale = 2)->nullable();
$table->integer('parent_id')->nullable();
if (!Schema::hasColumn('shift_online_items', 'count_real')) {
$table->decimal('count_real', $precision = 16, $scale = 2)->nullable();
}
if (!Schema::hasColumn('shift_online_items', 'count_return')) {
$table->decimal('count_return', $precision = 16, $scale = 2)->nullable();
}
if (!Schema::hasColumn('shift_online_items', 'parent_id')) {
$table->integer('parent_id')->nullable();
}
});
Schema::table('shift_online_actions', function (Blueprint $table) {
$table->integer('terminal_id')->nullable();
if (!Schema::hasColumn('shift_online_actions', 'terminal_id')) {
$table->integer('terminal_id')->nullable();
}
});
Schema::table('exchange_orders', function (Blueprint $table) {
$table->string('table_place')->nullable();
if (!Schema::hasColumn('exchange_orders', 'table_place')) {
$table->string('table_place')->nullable();
}
});
Schema::table('exchange_items', function (Blueprint $table) {
$table->integer('modificator_code')->nullable();
if (!Schema::hasColumn('exchange_items', 'modificator_code')) {
$table->integer('modificator_code')->nullable();
}
});
}

View File

@@ -11,9 +11,11 @@ class AddColumnsToUnitsList extends Migration {
* @return void
*/
public function up() {
Schema::table('units_list', function (Blueprint $table) {
$table->string('legacy_code')->nullable();
});
if (!Schema::hasColumn('units_list', 'legacy_code')) {
Schema::table('units_list', function (Blueprint $table) {
$table->string('legacy_code')->nullable();
});
}
}
/**

View File

@@ -142,7 +142,7 @@
console.log(data.message);
setTimeout(function() {
location.reload();
}, 2000);
}, 20000);
}
if ($scope.status == 'error') {
Notification.error(data.message);