add constaint on stock

This commit is contained in:
Ludovic CANDELLIER
2022-03-07 20:17:50 +01:00
parent 5794cbb045
commit 30876ba67d
6 changed files with 9 additions and 122 deletions

View File

@@ -1,42 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateActivityLogTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('activity_log', function(Blueprint $table)
{
$table->bigInteger('id', true)->unsigned();
$table->string('log_name')->nullable()->index();
$table->text('description', 65535);
$table->bigInteger('subject_id')->unsigned()->nullable();
$table->string('subject_type')->nullable();
$table->bigInteger('causer_id')->unsigned()->nullable();
$table->string('causer_type')->nullable();
$table->text('properties', 65535)->nullable();
$table->timestamps();
$table->index(['subject_id','subject_type'], 'subject');
$table->index(['causer_id','causer_type'], 'causer');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('activity_log');
}
}

View File

@@ -1,41 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateCategoriesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('categories', function(Blueprint $table)
{
$table->increments('id');
$table->string('slug')->unique();
$table->text('name', 65535);
$table->text('description', 65535)->nullable();
$table->integer('_lft')->unsigned()->default(0);
$table->integer('_rgt')->unsigned()->default(0);
$table->integer('parent_id')->unsigned()->nullable();
$table->timestamps();
$table->softDeletes();
$table->index(['_lft','_rgt','parent_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('categories');
}
}

View File

@@ -1,37 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateCategorizablesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('categorizables', function(Blueprint $table)
{
$table->integer('category_id')->unsigned();
$table->string('categorizable_type');
$table->bigInteger('categorizable_id')->unsigned();
$table->timestamps();
$table->unique(['category_id','categorizable_id','categorizable_type'], 'categorizables_ids_type_unique');
$table->index(['categorizable_type','categorizable_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('categorizables');
}
}