first upload all files

This commit is contained in:
NW
2023-06-11 13:14:03 +01:00
parent f14dbc52b5
commit c08b36d1b6
1705 changed files with 106852 additions and 0 deletions

View File

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

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFlashSaleTranslationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('flash_sale_translations', function (Blueprint $table) {
$table->increments('id');
$table->integer('flash_sale_id')->unsigned();
$table->string('locale');
$table->string('campaign_name');
$table->unique(['flash_sale_id', 'locale']);
$table->foreign('flash_sale_id')->references('id')->on('flash_sales')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('flash_sale_translations');
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFlashSaleProductsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('flash_sale_products', function (Blueprint $table) {
$table->increments('id');
$table->integer('flash_sale_id')->unsigned();
$table->integer('product_id')->unsigned();
$table->date('end_date');
$table->decimal('price', 18, 4)->unsigned();
$table->integer('qty');
$table->integer('position');
$table->foreign('flash_sale_id')->references('id')->on('flash_sales')->onDelete('cascade');
$table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('flash_sale_products');
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFlashSaleProductOrdersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('flash_sale_product_orders', function (Blueprint $table) {
$table->integer('flash_sale_product_id')->unsigned();
$table->integer('order_id')->unsigned();
$table->integer('qty');
$table->primary(['flash_sale_product_id', 'order_id']);
$table->foreign('flash_sale_product_id')->references('id')->on('flash_sale_products')->onDelete('cascade');
$table->foreign('order_id')->references('id')->on('orders')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('flash_sale_product_orders');
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace Modules\FlashSale\Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class FlashSaleDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
// $this->call("OthersTableSeeder");
}
}