This commit is contained in:
Meghdad committed 2026-08-24 19:44:24 +03:30
commit 8d5446f466
232 files changed
+25416

No files matched your search

@@ -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');
}
};
@@ -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->bigInteger('expiration')->index();
});
Schema::create('cache_locks', function (Blueprint $table) {
$table->string('key')->primary();
$table->string('owner');
$table->bigInteger('expiration')->index();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('cache');
Schema::dropIfExists('cache_locks');
}
};
@@ -0,0 +1,59 @@
<?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->unsignedSmallInteger('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->string('connection');
$table->string('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
$table->index(['connection', 'queue', 'failed_at']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('jobs');
Schema::dropIfExists('job_batches');
Schema::dropIfExists('failed_jobs');
}
};
@@ -0,0 +1,55 @@
<?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('mobile_apps', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('package_name')->unique();
$table->text('client_key');
$table->text('management_key');
$table->boolean('is_active')->default(true)->index();
$table->boolean('maintenance_mode')->default(false);
$table->string('latest_version_name')->nullable();
$table->unsignedBigInteger('latest_version_code')->nullable();
$table->unsignedBigInteger('minimum_version_code')->nullable();
$table->text('store_url')->nullable();
$table->text('privacy_url')->nullable();
$table->string('support_email')->nullable();
$table->json('configuration')->nullable();
$table->json('feature_flags')->nullable();
$table->text('bazaar_api_secret')->nullable();
$table->string('bazaar_comments_header')->nullable();
$table->text('bazaar_comments_secret')->nullable();
$table->string('bazaar_login_client_id')->nullable();
$table->text('bazaar_login_client_secret')->nullable();
$table->text('bazaar_login_redirect_url')->nullable();
$table->text('bazaar_billing_public_key')->nullable();
$table->boolean('bazaar_sync_enabled')->default(true)->index();
$table->unsignedSmallInteger('bazaar_sync_interval_minutes')->default(15);
$table->string('bazaar_sync_status')->default('idle')->index();
$table->timestamp('bazaar_sync_started_at')->nullable();
$table->timestamp('bazaar_last_synced_at')->nullable()->index();
$table->text('bazaar_sync_error')->nullable();
$table->json('bazaar_sync_summary')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('mobile_apps');
}
};
@@ -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('mobile_app_user', function (Blueprint $table) {
$table->id();
$table->foreignId('mobile_app_id')->constrained()->cascadeOnDelete();
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
$table->string('role')->default('admin');
$table->timestamps();
$table->unique(['mobile_app_id', 'user_id']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('mobile_app_user');
}
};
@@ -0,0 +1,39 @@
<?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('bazaar_purchases', function (Blueprint $table) {
$table->id();
$table->foreignId('mobile_app_id')->constrained()->cascadeOnDelete();
$table->string('product_id')->index();
$table->text('purchase_token');
$table->char('purchase_token_hash', 64);
$table->string('status')->default('unknown')->index();
$table->boolean('is_consumed')->nullable();
$table->timestamp('purchased_at')->nullable()->index();
$table->timestamp('validated_at')->nullable();
$table->json('bazaar_response')->nullable();
$table->timestamps();
$table->unique(['mobile_app_id', 'purchase_token_hash']);
$table->index(['mobile_app_id', 'validated_at']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('bazaar_purchases');
}
};
@@ -0,0 +1,41 @@
<?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('bazaar_subscriptions', function (Blueprint $table) {
$table->id();
$table->foreignId('mobile_app_id')->constrained()->cascadeOnDelete();
$table->string('subscription_id')->index();
$table->text('purchase_token');
$table->char('purchase_token_hash', 64);
$table->string('linked_subscription_token')->nullable()->index();
$table->string('status')->default('unknown')->index();
$table->boolean('auto_renewing')->nullable();
$table->timestamp('starts_at')->nullable();
$table->timestamp('valid_until')->nullable()->index();
$table->timestamp('validated_at')->nullable();
$table->json('bazaar_response')->nullable();
$table->timestamps();
$table->unique(['mobile_app_id', 'purchase_token_hash']);
$table->index(['mobile_app_id', 'validated_at']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('bazaar_subscriptions');
}
};
@@ -0,0 +1,39 @@
<?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('bazaar_releases', function (Blueprint $table) {
$table->id();
$table->foreignId('mobile_app_id')->constrained()->cascadeOnDelete();
$table->unsignedBigInteger('bazaar_release_id')->nullable()->index();
$table->string('status')->index();
$table->string('artifact_type')->nullable();
$table->unsignedInteger('staged_rollout_percentage')->default(100);
$table->boolean('auto_publish')->default(false);
$table->text('changelog_fa')->nullable();
$table->text('changelog_en')->nullable();
$table->text('developer_note')->nullable();
$table->json('bazaar_response')->nullable();
$table->timestamp('committed_at')->nullable();
$table->timestamp('published_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('bazaar_releases');
}
};
@@ -0,0 +1,41 @@
<?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('bazaar_reviews', function (Blueprint $table) {
$table->id();
$table->foreignId('mobile_app_id')->constrained()->cascadeOnDelete();
$table->unsignedBigInteger('bazaar_review_id');
$table->string('user_account_id')->nullable();
$table->unsignedTinyInteger('rate')->index();
$table->text('text');
$table->unsignedBigInteger('app_version_code')->nullable()->index();
$table->boolean('is_edited')->default(false);
$table->timestamp('published_at')->nullable()->index();
$table->text('developer_reply_text')->nullable();
$table->string('developer_reply_email')->nullable();
$table->timestamp('developer_replied_at')->nullable();
$table->json('bazaar_response')->nullable();
$table->timestamps();
$table->unique(['mobile_app_id', 'bazaar_review_id']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('bazaar_reviews');
}
};
@@ -0,0 +1,37 @@
<?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('bazaar_api_requests', function (Blueprint $table) {
$table->id();
$table->foreignId('mobile_app_id')->constrained()->cascadeOnDelete();
$table->string('operation')->index();
$table->string('method', 10);
$table->text('url');
$table->unsignedSmallInteger('status_code')->nullable()->index();
$table->boolean('successful')->default(false)->index();
$table->unsignedInteger('duration_ms')->nullable();
$table->json('request_metadata')->nullable();
$table->json('response_body')->nullable();
$table->text('error_message')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('bazaar_api_requests');
}
};