Sync
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('country_locales', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('slug')->unique();
|
||||
$table->string('i18n')->unique();
|
||||
$table->string('country_iso');
|
||||
$table->string('lang');
|
||||
$table->boolean('enabled')->default(false);
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('country_locales');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
<?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('authors', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('avatar');
|
||||
$table->string('bio');
|
||||
$table->boolean('enabled')->default(true);
|
||||
$table->boolean('public')->default(true);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('authors');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
<?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('posts', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title')->nullable();
|
||||
$table->string('slug')->nullable();
|
||||
$table->text('cliffhanger')->nullable();
|
||||
$table->mediumText('excerpt')->nullable();
|
||||
$table->foreignId('author_id')->nullable();
|
||||
$table->datetime('publish_date')->nullable();
|
||||
$table->boolean('featured')->default(false);
|
||||
$table->string('featured_image')->nullable();
|
||||
$table->enum('editor', ['editorjs', 'markdown'])->default('editorjs');
|
||||
$table->json('body')->nullable();
|
||||
$table->enum('post_format', ['standard'])->default('standard');
|
||||
$table->integer('comment_count')->default(0);
|
||||
$table->integer('likes_count')->default(0);
|
||||
$table->enum('status', ['publish', 'future', 'draft', 'private', 'trash'])->default('draft');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('author_id')->references('id')->on('authors');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('posts');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
<?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('post_categories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('post_id');
|
||||
$table->foreignId('category_id');
|
||||
|
||||
$table->foreign('post_id')->references('id')->on('posts');
|
||||
$table->foreign('category_id')->references('id')->on('categories');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('post_categories');
|
||||
}
|
||||
};
|
||||
@@ -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('shopee_seller_scrapes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('category_id');
|
||||
$table->string('seller');
|
||||
$table->string('country_iso');
|
||||
$table->bigInteger('epoch');
|
||||
$table->string('filename');
|
||||
$table->timestamp('last_ai_written_at')->nullable();
|
||||
$table->integer('write_counts')->default(0);
|
||||
$table->timestamps();
|
||||
$table->foreign('category_id')->references('id')->on('categories');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('shopee_seller_scrapes');
|
||||
}
|
||||
};
|
||||
@@ -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('shopee_seller_scraped_images', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('shopee_seller_scrape_id');
|
||||
$table->string('original_name');
|
||||
$table->string('image')->nullable();
|
||||
$table->boolean('featured')->default(false);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('shopee_seller_scrape_id')->references('id')->on('shopee_seller_scrapes');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('shopee_seller_scraped_images');
|
||||
}
|
||||
};
|
||||
@@ -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.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('ai_writeups', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('source');
|
||||
$table->string('source_url');
|
||||
$table->foreignId('category_id');
|
||||
$table->string('title');
|
||||
$table->string('editor_format');
|
||||
$table->mediumText('excerpt')->nullable();
|
||||
$table->string('featured_image')->nullable();
|
||||
$table->json('body')->nullable();
|
||||
$table->double('cost', 5, 5);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('category_id')->references('id')->on('categories');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('ai_writeups');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
<?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('shopee_seller_categories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('seller');
|
||||
$table->foreignId('category_id');
|
||||
$table->timestamp('last_ai_written_at')->nullable();
|
||||
$table->integer('write_counts')->default(0);
|
||||
$table->timestamps();
|
||||
$table->foreign('category_id')->references('id')->on('categories');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('shopee_seller_categories');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
<?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('daily_task_schedules', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('task');
|
||||
$table->timestamp('next_run_time');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('daily_task_schedules');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user