Init
This commit is contained in:
49
database/migrations/0001_01_01_000000_create_users_table.php
Normal file
49
database/migrations/0001_01_01_000000_create_users_table.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
||||
$table->string('email')->primary();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::create('sessions', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->foreignId('user_id')->nullable()->index();
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->text('user_agent')->nullable();
|
||||
$table->longText('payload');
|
||||
$table->integer('last_activity')->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
Schema::dropIfExists('password_reset_tokens');
|
||||
Schema::dropIfExists('sessions');
|
||||
}
|
||||
};
|
||||
35
database/migrations/0001_01_01_000001_create_cache_table.php
Normal file
35
database/migrations/0001_01_01_000001_create_cache_table.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('cache', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->mediumText('value');
|
||||
$table->integer('expiration');
|
||||
});
|
||||
|
||||
Schema::create('cache_locks', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->string('owner');
|
||||
$table->integer('expiration');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('cache');
|
||||
Schema::dropIfExists('cache_locks');
|
||||
}
|
||||
};
|
||||
57
database/migrations/0001_01_01_000002_create_jobs_table.php
Normal file
57
database/migrations/0001_01_01_000002_create_jobs_table.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('queue')->index();
|
||||
$table->longText('payload');
|
||||
$table->unsignedTinyInteger('attempts');
|
||||
$table->unsignedInteger('reserved_at')->nullable();
|
||||
$table->unsignedInteger('available_at');
|
||||
$table->unsignedInteger('created_at');
|
||||
});
|
||||
|
||||
Schema::create('job_batches', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->string('name');
|
||||
$table->integer('total_jobs');
|
||||
$table->integer('pending_jobs');
|
||||
$table->integer('failed_jobs');
|
||||
$table->longText('failed_job_ids');
|
||||
$table->mediumText('options')->nullable();
|
||||
$table->integer('cancelled_at')->nullable();
|
||||
$table->integer('created_at');
|
||||
$table->integer('finished_at')->nullable();
|
||||
});
|
||||
|
||||
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.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('jobs');
|
||||
Schema::dropIfExists('job_batches');
|
||||
Schema::dropIfExists('failed_jobs');
|
||||
}
|
||||
};
|
||||
@@ -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.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
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->timestamp('expires_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('personal_access_tokens');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('products', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('code')->unique();
|
||||
$table->text('url')->nullable();
|
||||
$table->string('creator')->nullable();
|
||||
$table->bigInteger('created_t')->nullable();
|
||||
$table->string('created_datetime')->nullable();
|
||||
$table->bigInteger('last_modified_t')->nullable();
|
||||
$table->string('last_modified_datetime')->nullable();
|
||||
$table->string('last_modified_by')->nullable();
|
||||
$table->bigInteger('last_updated_t')->nullable();
|
||||
$table->string('last_updated_datetime')->nullable();
|
||||
$table->text('product_name')->nullable();
|
||||
$table->text('abbreviated_product_name')->nullable();
|
||||
$table->text('generic_name')->nullable();
|
||||
$table->string('quantity')->nullable();
|
||||
$table->text('packaging')->nullable();
|
||||
$table->text('packaging_tags')->nullable();
|
||||
$table->text('packaging_en')->nullable();
|
||||
$table->text('packaging_text')->nullable();
|
||||
$table->text('brands')->nullable();
|
||||
$table->text('brands_tags')->nullable();
|
||||
$table->text('categories')->nullable();
|
||||
$table->text('categories_tags')->nullable();
|
||||
$table->text('categories_en')->nullable();
|
||||
$table->text('origins')->nullable();
|
||||
$table->text('origins_tags')->nullable();
|
||||
$table->text('origins_en')->nullable();
|
||||
$table->text('manufacturing_places')->nullable();
|
||||
$table->text('manufacturing_places_tags')->nullable();
|
||||
$table->text('labels')->nullable();
|
||||
$table->text('labels_tags')->nullable();
|
||||
$table->text('labels_en')->nullable();
|
||||
$table->text('emb_codes')->nullable();
|
||||
$table->text('emb_codes_tags')->nullable();
|
||||
$table->text('first_packaging_code_geo')->nullable();
|
||||
$table->text('cities')->nullable();
|
||||
$table->text('cities_tags')->nullable();
|
||||
$table->text('purchase_places')->nullable();
|
||||
$table->text('stores')->nullable();
|
||||
$table->text('countries')->nullable();
|
||||
$table->text('countries_tags')->nullable();
|
||||
$table->text('countries_en')->nullable();
|
||||
$table->text('ingredients_text')->nullable();
|
||||
$table->text('ingredients_tags')->nullable();
|
||||
$table->text('ingredients_analysis_tags')->nullable();
|
||||
$table->text('allergens')->nullable();
|
||||
$table->text('allergens_en')->nullable();
|
||||
$table->text('traces')->nullable();
|
||||
$table->text('traces_tags')->nullable();
|
||||
$table->text('traces_en')->nullable();
|
||||
$table->text('serving_size')->nullable();
|
||||
$table->float('serving_quantity')->nullable();
|
||||
$table->boolean('no_nutrition_data')->default(false);
|
||||
$table->integer('additives_n')->nullable();
|
||||
$table->text('additives')->nullable();
|
||||
$table->text('additives_tags')->nullable();
|
||||
$table->text('additives_en')->nullable();
|
||||
$table->integer('nutriscore_score')->nullable();
|
||||
$table->string('nutriscore_grade')->nullable();
|
||||
$table->integer('nova_group')->nullable();
|
||||
$table->text('pnns_groups_1')->nullable();
|
||||
$table->text('pnns_groups_2')->nullable();
|
||||
$table->text('food_groups')->nullable();
|
||||
$table->text('food_groups_tags')->nullable();
|
||||
$table->text('food_groups_en')->nullable();
|
||||
$table->text('states')->nullable();
|
||||
$table->text('states_tags')->nullable();
|
||||
$table->text('states_en')->nullable();
|
||||
$table->text('brand_owner')->nullable();
|
||||
$table->integer('ecoscore_score')->nullable();
|
||||
$table->string('ecoscore_grade')->nullable();
|
||||
$table->text('nutrient_levels_tags')->nullable();
|
||||
$table->string('product_quantity')->nullable();
|
||||
$table->string('owner')->nullable();
|
||||
$table->text('data_quality_errors_tags')->nullable();
|
||||
$table->integer('unique_scans_n')->nullable();
|
||||
$table->text('popularity_tags')->nullable();
|
||||
$table->float('completeness')->nullable();
|
||||
$table->bigInteger('last_image_t')->nullable();
|
||||
$table->string('last_image_datetime')->nullable();
|
||||
$table->text('main_category')->nullable();
|
||||
$table->text('main_category_en')->nullable();
|
||||
$table->text('image_url')->nullable();
|
||||
$table->text('image_small_url')->nullable();
|
||||
$table->text('image_ingredients_url')->nullable();
|
||||
$table->text('image_ingredients_small_url')->nullable();
|
||||
$table->text('image_nutrition_url')->nullable();
|
||||
$table->text('image_nutrition_small_url')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('ingredients', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('product_code');
|
||||
$table->foreign('product_code')->references('code')->on('products')->onDelete('cascade');
|
||||
$table->text('name');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('nutrition_facts', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('product_code');
|
||||
$table->foreign('product_code')->references('code')->on('products')->onDelete('cascade');
|
||||
$table->string('nutrient');
|
||||
$table->float('amount')->nullable();
|
||||
$table->string('unit')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('nutrition_facts');
|
||||
Schema::dropIfExists('ingredients');
|
||||
Schema::dropIfExists('products');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user