Add student achievements module and improve student admin workflows
This commit is contained in:
@@ -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
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('student_achievements', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('student_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate();
|
||||
$table->string('achievement_name', 150);
|
||||
$table->string('category', 100)->nullable();
|
||||
$table->string('level', 50)->nullable();
|
||||
$table->string('organizer', 150)->nullable();
|
||||
$table->string('rank', 100)->nullable();
|
||||
$table->date('achievement_date')->nullable();
|
||||
$table->year('achievement_year')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->string('certificate_file', 255)->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['student_id', 'achievement_year']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('student_achievements');
|
||||
}
|
||||
};
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?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::table('student_achievements', function (Blueprint $table) {
|
||||
$table->string('activity_photo', 255)->nullable()->after('certificate_file');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('student_achievements', function (Blueprint $table) {
|
||||
$table->dropColumn('activity_photo');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user