RSM-8 Add team files page and ability to download files

This commit is contained in:
2020-10-11 02:54:09 +01:00
parent b8a2a64354
commit 06d1e0ad3f
15 changed files with 511 additions and 17 deletions

View File

@@ -0,0 +1,48 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTeamFilesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('team_files', function (Blueprint $table) {
$table->id();
$table->bigInteger('uploaded_by')->unsigned()->index();
$table->integer('team_id')->unsigned()->index();
$table->string('name');
$table->string('fs_location'); // filesystem location
$table->string('extension');
$table->timestamps();
$table->foreign('uploaded_by')
->references('id')
->on('users')
->cascadeOnDelete()
->cascadeOnUpdate();
$table->foreign('team_id')
->references('id')
->on('teams')
->cascadeOnDelete()
->cascadeOnUpdate();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('team_files');
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddDetailsToTeamFiles extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('team_files', function (Blueprint $table) {
$table->integer('size')->nullable()->after('extension');
$table->string('caption')->nullable()->after('name');
$table->mediumText('description')->nullable()->after('caption');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('team_files', function (Blueprint $table) {
$table->dropColumn('size');
$table->dropColumn('caption');
$table->dropColumn('description');
});
}
}