Add user invitation facilities RSM-5
Adds user invitation to teams, and framework for assigning taems Also adds user acc. deletion.
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class VacancyNullableTeamId extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('vacancies', function(Blueprint $table){
|
||||
|
||||
$table->dropForeign('vacancies_ownerteamid_foreign');
|
||||
$table->dropColumn('ownerTeamID');
|
||||
$table->bigInteger('team_id')->nullable()->unsigned();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('vacancies', function(Blueprint $table){
|
||||
|
||||
$table->dropColumn('team_id');
|
||||
|
||||
});
|
||||
}
|
||||
}
|
43
database/migrations/2020_10_04_163715_team_has_vacancy.php
Normal file
43
database/migrations/2020_10_04_163715_team_has_vacancy.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class TeamHasVacancy extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('team_has_vacancy', function(Blueprint $table){
|
||||
|
||||
$table->id();
|
||||
$table->integer('team_id')->unsigned();
|
||||
$table->bigInteger('vacancy_id')->unsigned();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('team_id')
|
||||
->references('id')
|
||||
->on(config('teamwork.teams_table'));
|
||||
|
||||
$table->foreign('vacancy_id')
|
||||
->references('id')
|
||||
->on('vacancies');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddTeamAssocToVacancies extends Migration
|
||||
class AddAccountTokensToUser extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
@@ -13,13 +13,8 @@ class AddTeamAssocToVacancies extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('vacancies', function (Blueprint $table) {
|
||||
|
||||
$table->integer('ownerTeamID')->unsigned()->after('vacancyFormID');
|
||||
|
||||
$table->foreign('ownerTeamID')
|
||||
->references('id')
|
||||
->on('teams');
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->string('account_tokens')->after('password')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -30,8 +25,8 @@ class AddTeamAssocToVacancies extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('vacancies', function (Blueprint $table) {
|
||||
//
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('account_tokens');
|
||||
});
|
||||
}
|
||||
}
|
@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddTeamIDToVacancy extends Migration
|
||||
class AddSoftDeletesToUsers extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
@@ -13,8 +13,8 @@ class AddTeamIDToVacancy extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('vacancy', function (Blueprint $table) {
|
||||
//
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->softDeletes()->after('account_tokens');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ class AddTeamIDToVacancy extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('vacancy', function (Blueprint $table) {
|
||||
//
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropSoftDeletes();
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user