sifatbaho

This commit is contained in:
2026-04-05 05:31:24 +05:00
commit df3d57f503
2609 changed files with 369825 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
<?php
use App\Enums\RoleEnum;
use App\Models\User;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('phone')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->text('avatar');
$table->rememberToken();
$table->string('status', 10)->default('inactive');
$table->string('role', 15)->nullable(true)->default(RoleEnum::USER->name);
$table->bigInteger('balance')->default(0);
$table->dateTime('last_login')->nullable();
$table->timestamps();
});
User::create(['name' => 'admin', 'phone' => '+998-99-208-08-02', 'password' => Hash::make('123456'), 'email_verified_at' => '2022-01-02 17:04:58', 'avatar' => '/assets/images/users/avatar-5.jpg', 'created_at' => now(), 'role' => 'admin']);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('phone')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFailedJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('failed_jobs');
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePersonalAccessTokensTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('personal_access_tokens', function (Blueprint $table) {
$table->id();
$table->morphs('tokenable');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('personal_access_tokens');
}
}

View File

@@ -0,0 +1,72 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// DB::statement("create sequence if not exists order_number_seq start 1001 increment 1");
Schema::create('auto_orders', function (Blueprint $table) {
$table->id();
$table->string("number");
// $table->foreignId("diller_id")->references('id')->on('users');
$table->bigInteger("diller_id")->nullable();
$table->string("ordered_customer")->nullable();
$table->string("ordered_customer_phone")->nullable();
$table->string("purpose");
$table->string("car_mark");
$table->string("car_category");
$table->string("car_subcategory");
$table->bigInteger("cost", false,)->comment("cost of service");
$table->string("note", 1024)->nullable();
$table->bigInteger("price", false, true)->nullable()->comment("paid by customer summ");
$table->string("price_note", 1024)->nullable()->comment("note on time evaluate order");
$table->string("status");
$table->string('customer_first_name')->nullable()->comment("null when customer is juridical");
$table->string('customer_last_name')->nullable()->comment("null when customer is juridical");
$table->string('customer_patronymic')->nullable()->comment("null when customer is juridical");
$table->string('customer_company')->nullable()->comment("null when customer is physical");
$table->string('customer_type');
$table->string('owner_first_name')->nullable()->comment("null when owner is juridical");
$table->string('owner_last_name')->nullable()->comment("null when owner is juridical");
$table->string('owner_patronymic')->nullable()->comment("null when owner is juridical");
$table->string('owner_company')->nullable()->comment("null when owner is physical");
$table->string('owner_type');
$table->string('car_number');
$table->string('body');
$table->string('engine');
$table->string('color')->nullable();
$table->string('tech_passport')->nullable();
$table->string('tech_given_date')->nullable();
$table->string('tech_given_whom')->nullable();
$table->string('type');
$table->string('shassi');
$table->string('made_date');
$table->bigInteger('object_price')->nullable()->comment("order evaluated price");
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('auto_orders');
}
};

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('files', function (Blueprint $table) {
$table->uuid('id')->unique();
$table->string('path');
$table->string('extension', 5);
$table->integer('order_id');
$table->string('type')->default('ALL');
$table->string('name')->default('File uploaded');
$table->string('size')->default(1);
$table->bigInteger('size_in_bytes')->default(0);
$table->string('order_type')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('files');
}
};

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('order_members', function (Blueprint $table) {
$table->id();
$table->integer('order_id');
$table->integer('user_id');
$table->string('note')->nullable();
$table->string('order_type')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('order_members');
}
};

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tracking_actions', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->references('id')->on('users')->nullable();
$table->bigInteger('order_id')->nullable();
$table->string('images')->nullable();
$table->string('msg');
$table->text('params');
$table->string('type');
$table->string('order_type')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('tracking_actions');
}
};

View File

@@ -0,0 +1,39 @@
<?php
use App\Models\Debit;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('debits', function (Blueprint $table) {
$table->id();
$table->foreignId('appraiser_id')->references('id')->on('users');
$table->bigInteger('order_id')->nullable();
$table->bigInteger("cost", false, true);
$table->string('customer');
$table->string('expired');
$table->string('order_type')->nullable();
$table->string('status')->default(Debit::$NOPAID);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('debits');
}
};

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('bonuses', function (Blueprint $table) {
$table->id();
$table->bigInteger('order_id')->nullable();
$table->foreignId('appraiser_id')->references('id')->on('users');
$table->bigInteger('amount')->default(0);
$table->string('order_type')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('bonuses');
}
};

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('certificates', function (Blueprint $table) {
$table->id();
$table->string('type')->nullable(false);
$table->string('path')->nullable(false);
$table->tinyInteger('sort')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('certificates');
}
};

View File

@@ -0,0 +1,69 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('estate_orders', function (Blueprint $table) {
$table->id();
$table->string("number");
$table->bigInteger("diller_id")->nullable();
$table->string("ordered_customer")->nullable();
$table->string("ordered_customer_phone")->nullable();
$table->string("purpose");
$table->bigInteger("cost", false)->comment("cost of service");
$table->string("note", 1024)->nullable();
$table->bigInteger("price", false, true)->nullable()->comment("paid by customer summ");
$table->string("price_note", 1024)->nullable()->comment("note on time evaluate order");
$table->string("status");
$table->string('customer_first_name')->nullable()->comment("null when customer is juridical");
$table->string('customer_last_name')->nullable()->comment("null when customer is juridical");
$table->string('customer_patronymic')->nullable()->comment("null when customer is juridical");
$table->string('customer_company')->nullable()->comment("null when customer is physical");
$table->string('customer_type');
$table->string('owner_first_name')->nullable()->comment("null when owner is juridical");
$table->string('owner_last_name')->nullable()->comment("null when owner is juridical");
$table->string('owner_patronymic')->nullable()->comment("null when owner is juridical");
$table->string('owner_company')->nullable()->comment("null when owner is physical");
$table->string('owner_type');
$table->string('contract_date');
$table->string('name_of_object');
$table->string('address');
$table->string('region');
$table->string('district');
$table->string('home');
$table->string('area')->nullable();
$table->string('overall_area')->nullable();
$table->string('usefull_area')->nullable();
$table->string('live_area')->nullable();
$table->string('tech_given_date')->nullable();
$table->string('tech_passport')->nullable();
$table->string('tech_given_whom')->nullable();
$table->bigInteger('object_price')->nullable()->comment("order evaluated price");
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('estate_orders');
}
};

View File

@@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user_infos', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->references('id')->on('users');
$table->string('first_name');
$table->string('last_name');
$table->string('email');
$table->text('description');
$table->string('address');
$table->string('cover');
$table->string('skills');
$table->string('company');
$table->float('completed');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('user_infos');
}
};

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('purposes', function (Blueprint $table) {
$table->id();
$table->string('uz');
$table->string('ru');
$table->string('cr');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('purposes');
}
};

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('regions', function (Blueprint $table) {
$table->id();
$table->string('uz');
$table->string('ru');
$table->string('cr');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('regions');
}
};

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('districts', function (Blueprint $table) {
$table->id();
$table->string('uz');
$table->string('ru');
$table->string('cr');
$table->integer('region_id');//->references('id')->on('region');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('districts');
}
};

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('concerns', function (Blueprint $table) {
$table->id();
$table->string('uz');
$table->string('ru');
$table->string('cr');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('concerns');
}
};