mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-11 18:51:06 +03:30
add pack and update items & packegs & cycles
This commit is contained in:
@@ -17,7 +17,7 @@ class CreateUsersTable extends Migration
|
||||
$table->bigIncrements('id');
|
||||
$table->string('name');
|
||||
$table->string('email')->nullable();
|
||||
$table->string('country_code');
|
||||
$table->string('country_code')->default('0098');;
|
||||
$table->string('cell_number');
|
||||
$table->enum('gender', ['Male','FeMale'])->default('Male');
|
||||
$table->enum('verified', ['Verified','NotVerified'])->default('NotVerified');
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ class CreateTestResultsTable extends Migration
|
||||
$table->bigIncrements('id');
|
||||
$table->string('info');
|
||||
$table->string('cycle_number');
|
||||
$table->date('date')->nullable();
|
||||
$table->string('result');
|
||||
$table->text('description');
|
||||
$table->smallInteger('verified');
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreatePackagesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('packages', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('name');
|
||||
$table->string('unique_id');
|
||||
$table->text('note')->nullable();
|
||||
$table->enum('verified', ['Verified', 'NotVerified']);
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('packages');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateItemsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('items', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('name');
|
||||
$table->string('size');
|
||||
$table->string('unique_id');
|
||||
$table->string('specific');
|
||||
$table->text('note')->nullable();
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('items');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateItemPackageTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('item_package', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('item_id');
|
||||
$table->foreign('item_id')->references('id')->on('items');
|
||||
$table->unsignedBigInteger('package_id');
|
||||
$table->foreign('package_id')->references('id')->on('packages');
|
||||
// $table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('item_package');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateCyclesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('cycles', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('name');
|
||||
$table->date('date');
|
||||
$table->string('sterilizer_id');
|
||||
$table->text('note')->nullable();
|
||||
$table->enum('verified',['Verified', 'NotVerified']);
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('cycles');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateTablePackes extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('packes', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->date('sterile_date')->nullable();
|
||||
$table->date('expire_date')->nullable();
|
||||
$table->string('sterilizer_id');
|
||||
$table->string('cycle_number');
|
||||
$table->string('lot_number');
|
||||
$table->string('department');
|
||||
$table->text('note')->nullable();
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('packes');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateTablePackPackage extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('pack_package', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('pack_id');
|
||||
$table->foreign('pack_id')->references('id')->on('packes');
|
||||
$table->unsignedBigInteger('package_id');
|
||||
$table->foreign('package_id')->references('id')->on('packages');
|
||||
// $table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('pack_package');
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateCyclePackageTable extends Migration
|
||||
class CreateTableCyclePack extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
@@ -13,12 +13,12 @@ class CreateCyclePackageTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('cycle_package', function (Blueprint $table) {
|
||||
Schema::create('cycle_pack', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->integer('cycle_id')->unsigned();
|
||||
$table->integer('package_id')->unsigned();
|
||||
$table->unsignedBigInteger('pack_id');
|
||||
$table->foreign('pack_id')->references('id')->on('packes');
|
||||
$table->unsignedBigInteger('cycle_id');
|
||||
$table->foreign('cycle_id')->references('id')->on('cycles');
|
||||
$table->foreign('package_id')->references('id')->on('packages');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
@@ -30,6 +30,6 @@ class CreateCyclePackageTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('cycle_package');
|
||||
Schema::dropIfExists('cycle_pack');
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('name');
|
||||
$table->string('email')->nullable();
|
||||
$table->string('country_code')->default('0098');;
|
||||
$table->string('cell_number');
|
||||
$table->enum('gender', ['Male','FeMale'])->default('Male');
|
||||
$table->enum('verified', ['Verified','NotVerified'])->default('NotVerified');
|
||||
$table->enum('status', ['Active','Suspended'])->default('Active');
|
||||
$table->unsignedBigInteger('medical_center_id');
|
||||
$table->foreign('medical_center_id')->references('id')->on('medical_centers');
|
||||
$table->string('password');
|
||||
$table->string('address')->nullable();
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
}
|
||||
}
|
||||
@@ -17,9 +17,8 @@ class CreatePackagesTable extends Migration
|
||||
$table->bigIncrements('id');
|
||||
$table->string('name');
|
||||
$table->string('unique_id');
|
||||
$table->enum('result',array('Pass', 'Fail'));
|
||||
$table->text('description');
|
||||
$table->enum('verified',array('Verified', 'NotVerified'));
|
||||
$table->text('note')->nullable();
|
||||
$table->enum('verified', ['Verified', 'NotVerified']);
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
$table->timestamps();
|
||||
|
||||
@@ -16,7 +16,10 @@ class CreateItemsTable extends Migration
|
||||
Schema::create('items', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('name');
|
||||
$table->text('description');
|
||||
$table->string('size');
|
||||
$table->string('unique_id');
|
||||
$table->string('specific');
|
||||
$table->text('note')->nullable();
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
$table->timestamps();
|
||||
|
||||
@@ -15,11 +15,11 @@ class CreateItemPackageTable extends Migration
|
||||
{
|
||||
Schema::create('item_package', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->integer('item_id')->unsigned();
|
||||
$table->integer('package_id')->unsigned();
|
||||
$table->unsignedBigInteger('item_id');
|
||||
$table->foreign('item_id')->references('id')->on('items');
|
||||
$table->unsignedBigInteger('package_id');
|
||||
$table->foreign('package_id')->references('id')->on('packages');
|
||||
$table->timestamps();
|
||||
// $table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ class CreateCyclesTable extends Migration
|
||||
Schema::create('cycles', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('name');
|
||||
$table->string('unique_id');
|
||||
$table->enum('result',['Pass', 'Fail']);
|
||||
$table->text('description');
|
||||
$table->date('date');
|
||||
$table->string('sterilizer_id');
|
||||
$table->text('note')->nullable();
|
||||
$table->enum('verified',['Verified', 'NotVerified']);
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateTablePackes extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('packes', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('name');
|
||||
$table->string('unique_id');
|
||||
$table->date('sterile_date')->nullable();
|
||||
$table->date('expire_date')->nullable();
|
||||
$table->string('sterilizer_id');
|
||||
$table->string('cycle_number');
|
||||
$table->string('lot_number');
|
||||
$table->string('department');
|
||||
$table->text('note')->nullable();
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('packes');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateTablePackPackage extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('pack_package', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('pack_id');
|
||||
$table->foreign('pack_id')->references('id')->on('packes');
|
||||
$table->unsignedBigInteger('package_id');
|
||||
$table->foreign('package_id')->references('id')->on('packages');
|
||||
// $table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('pack_package');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateTableCyclePack extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('cycle_pack', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('pack_id');
|
||||
$table->foreign('pack_id')->references('id')->on('packes');
|
||||
$table->unsignedBigInteger('cycle_id');
|
||||
$table->foreign('cycle_id')->references('id')->on('cycles');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('cycle_pack');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user