add slug columns
This commit is contained in:
-1
@@ -14,7 +14,6 @@ return new class extends Migration
|
|||||||
Schema::create('additional_education_categories', function (Blueprint $table) {
|
Schema::create('additional_education_categories', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->string('title')->unique();
|
$table->string('title')->unique();
|
||||||
$table->string('slug')->unique();
|
|
||||||
$table->boolean('is_active');
|
$table->boolean('is_active');
|
||||||
$table->unsignedBigInteger('dir_addit_educat_id')->nullable();
|
$table->unsignedBigInteger('dir_addit_educat_id')->nullable();
|
||||||
$table->foreign('dir_addit_educat_id')->references('id')->on('direction_additional_education');
|
$table->foreign('dir_addit_educat_id')->references('id')->on('direction_additional_education');
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ return new class extends Migration
|
|||||||
Schema::create('additional_education', function (Blueprint $table) {
|
Schema::create('additional_education', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->string('title');
|
$table->string('title');
|
||||||
$table->string('slug')->unique();
|
|
||||||
$table->text('content');
|
$table->text('content');
|
||||||
$table->unsignedBigInteger('category_id')->nullable();
|
$table->unsignedBigInteger('category_id')->nullable();
|
||||||
$table->foreign('category_id')->references('id')->on('additional_education_categories');
|
$table->foreign('category_id')->references('id')->on('additional_education_categories');
|
||||||
|
|||||||
+28
@@ -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('additional_education_categories', function (Blueprint $table) {
|
||||||
|
$table->string('slug')->unique('slug')->after('title')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('additional_education_categories', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('slug');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -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('additional_education', function (Blueprint $table) {
|
||||||
|
$table->string('slug')->unique('slug')->after('title')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('additional_education', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('slug');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user