add_vk_module

This commit is contained in:
Fasutoa
2025-06-18 20:30:41 +05:00
parent b030000238
commit 0b60c4b908
18 changed files with 1432 additions and 62 deletions
@@ -0,0 +1,23 @@
<?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('telegraph_bots', function (Blueprint $table) {
$table->id();
$table->string('token')->unique();
$table->string('name')->nullable();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('telegraph_bots');
}
};
@@ -0,0 +1,26 @@
<?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('telegraph_chats', function (Blueprint $table) {
$table->id();
$table->string('chat_id');
$table->string('name')->nullable();
$table->foreignId('telegraph_bot_id')->constrained('telegraph_bots')->cascadeOnDelete();
$table->timestamps();
$table->unique(['chat_id', 'telegraph_bot_id']);
});
}
public function down(): void
{
Schema::dropIfExists('telegraph_chats');
}
};
@@ -0,0 +1,30 @@
<?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_tg_posts', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('post_id'); // Поле post_id
$table->unsignedBigInteger('tg_post_id'); // Поле vk_post_id
$table->dateTime('unchange_time_after');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('posts_tg_posts');
}
};
@@ -0,0 +1,28 @@
<?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::table('posts_tg_posts', function (Blueprint $table) {
$table->text('media_content')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('posts_tg_posts', function (Blueprint $table) {
$table->dropColumn('media_content');
});
}
};