You've already forked isop-mirror
Uprava
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?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_data', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->unique()->constrained('users')->cascadeOnDelete();
|
||||
$table->string('address')->nullable();
|
||||
$table->string('personal_email')->nullable();
|
||||
$table->string('study_field')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
public function down(): void {
|
||||
Schema::dropIfExists('student_data');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?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('employers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('company_id')->constrained('companies')->cascadeOnDelete();
|
||||
$table->foreignId('user_id')->unique()->constrained('users')->cascadeOnDelete();
|
||||
$table->string('position')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
public function down(): void {
|
||||
Schema::dropIfExists('employers');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?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('internships', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
|
||||
$table->foreignId('user_id')->constrained('users');
|
||||
$table->foreignId('company_id')->constrained('companies');
|
||||
$table->foreignId('employer_id')->nullable()->constrained('employers')->nullOnDelete();
|
||||
|
||||
|
||||
$table->string('agreement')->nullable();
|
||||
$table->date('start_date');
|
||||
$table->date('end_date');
|
||||
$table->enum('semester', ['ZS','LS']);
|
||||
$table->smallInteger('year_of_study');
|
||||
$table->text('position_description')->nullable();
|
||||
$table->boolean('is_paid')->default(false);
|
||||
|
||||
|
||||
$table->unsignedBigInteger('status_id')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['semester','company_id','user_id','status_id']);
|
||||
|
||||
});
|
||||
}
|
||||
public function down(): void {
|
||||
Schema::dropIfExists('internships');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?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('internship_statuses', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('internship_id')->constrained('internships')->cascadeOnDelete();
|
||||
$table->enum('status', ['SUBMITTED','CONFIRMED','DENIED','DEFENDED','NOT_DEFENDED']);
|
||||
$table->timestamp('changed')->useCurrent();
|
||||
$table->foreignId('modified_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->text('note')->nullable();
|
||||
$table->string('source', 30)->default('UI');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['internship_id','status']);
|
||||
});
|
||||
}
|
||||
public function down(): void {
|
||||
Schema::dropIfExists('internship_statuses');
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user