Add WooCommerce product and category management.
Deploy Ladill Woo Manager / deploy (push) Successful in 55s
Deploy Ladill Woo Manager / deploy (push) Successful in 55s
Sync catalog via plugin webhooks and REST proxy, with list/create/edit UI and updated logo from monolith assets. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('woo_categories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('woo_store_id')->constrained('woo_stores')->cascadeOnDelete();
|
||||
$table->unsignedBigInteger('external_id');
|
||||
$table->unsignedBigInteger('parent_external_id')->nullable();
|
||||
$table->string('name');
|
||||
$table->string('slug');
|
||||
$table->text('description')->nullable();
|
||||
$table->unsignedInteger('product_count')->default(0);
|
||||
$table->timestamp('wc_updated_at')->nullable();
|
||||
$table->json('metadata')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['woo_store_id', 'external_id']);
|
||||
$table->index(['woo_store_id', 'parent_external_id']);
|
||||
});
|
||||
|
||||
Schema::create('woo_products', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('woo_store_id')->constrained('woo_stores')->cascadeOnDelete();
|
||||
$table->unsignedBigInteger('external_id');
|
||||
$table->string('name');
|
||||
$table->string('slug');
|
||||
$table->string('sku')->nullable();
|
||||
$table->string('status')->default('draft');
|
||||
$table->string('type')->default('simple');
|
||||
$table->unsignedBigInteger('regular_price_minor')->nullable();
|
||||
$table->unsignedBigInteger('sale_price_minor')->nullable();
|
||||
$table->integer('stock_quantity')->nullable();
|
||||
$table->boolean('manage_stock')->default(false);
|
||||
$table->json('category_external_ids')->nullable();
|
||||
$table->json('images')->nullable();
|
||||
$table->text('short_description')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->timestamp('wc_updated_at')->nullable();
|
||||
$table->json('metadata')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['woo_store_id', 'external_id']);
|
||||
$table->index(['woo_store_id', 'status']);
|
||||
$table->index(['woo_store_id', 'sku']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('woo_products');
|
||||
Schema::dropIfExists('woo_categories');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user