Commit ff846673 authored by ZeMKI's avatar ZeMKI
Browse files

Initial commit

parents
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateQuestionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('questions', function (Blueprint $table) {
$table->increments('id');
$table->string('question', 255);
$table->string('detail', 255);
$table->integer('study_id')->nullable()->unsigned()->references('id')->on('studies')->onDelete('cascade');
$table->timestamps();
$table->foreign('study_id')->references('id')->on('studies');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('questions');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSortingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sortings', function (Blueprint $table) {
$table->increments('id');
$table->string('name', 255);
$table->text('description');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sortings');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateInterviewsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('interviews', function (Blueprint $table) {
$table->increments('id');
$table->string('author',255);
$table->string('interviewed',255);
$table->text('sorting_screenshot');
$table->integer('study_id')->nullable()->unsigned()->references('id')->on('studies')->onDelete('cascade');
$table->datetime('start');
$table->datetime('end');
$table->timestamps();
$table->foreign('study_id')->references('id')->on('studies');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('interviews');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFilesInterviewTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('files_interview', function (Blueprint $table) {
$table->increments('id');
$table->string('type',100);
$table->text('path');
$table->string('size',100);
$table->integer('interview_id')->nullable()->unsigned()->references('id')->on('interviews')->onDelete('cascade');
$table->timestamps();
$table->foreign('interview_id')->references('id')->on('interviews');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('files_interview');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAnswersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('answers', function (Blueprint $table) {
$table->increments('id');
$table->integer('question_id')->nullable()->unsigned()->references('id')->on('questions')->onDelete('cascade');
$table->json('answer');
$table->timestamps();
$table->foreign('question_id')->references('id')->on('questions');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('answers');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTokensTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tokens', function (Blueprint $table) {
$table->increments('id');
$table->string('name',255);
$table->text('image_path');
$table->integer('author')->nullable()->unsigned()->references('id')->on('users')->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('tokens');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateInterviewTokensTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('interview_tokens', function (Blueprint $table) {
$table->increments('id');
$table->integer('interview_id')->nullable()->unsigned()->references('id')->on('interviews')->onDelete('cascade');
$table->integer('token_id')->nullable()->unsigned()->references('id')->on('token')->onDelete('cascade');
$table->text('valutation');
$table->integer('sorting_id')->nullable()->unsigned()->references('id')->on('token')->onDelete('cascade');
$table->timestamps();
$table->foreign('interview_id')->references('id')->on('interviews');
$table->foreign('token_id')->references('id')->on('tokens');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('interview_tokens');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateStudySortingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('study_sortings', function (Blueprint $table) {
$table->increments('id');
$table->integer('sorting_id')->nullable()->unsigned()->references('id')->on('sortings')->onDelete('cascade');
$table->integer('study_id')->nullable()->unsigned()->references('id')->on('studies')->onDelete('cascade');
// info about the sorting, like number of circles or valutations min and max
$table->text('details')->nullable();
$table->timestamps();
$table->foreign('study_id')->references('id')->on('studies');
$table->foreign('sorting_id')->references('id')->on('sortings');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('study_sortings');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateKeyframesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('keyframes', function (Blueprint $table) {
$table->increments('id');
$table->string('annotation',255);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('keyframes');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFilesKeyframeTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('files_keyframe', function (Blueprint $table) {
$table->increments('id');
$table->integer('file_id')->nullable()->unsigned()->references('id')->on('files')->onDelete('cascade');
$table->integer('keyframe_id')->nullable()->unsigned()->references('id')->on('keyframe')->onDelete('cascade');
$table->timestamps();
$table->foreign('file_id')->references('id')->on('files_interview');
$table->foreign('keyframe_id')->references('id')->on('keyframes');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('files_keyframe');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateInterviewAnswersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('interview_answers', function (Blueprint $table) {
$table->increments('id');
$table->integer('interview_id')->nullable()->unsigned()->references('id')->on('interviews')->onDelete('cascade');
$table->integer('answer_id')->nullable()->unsigned()->references('id')->on('answers')->onDelete('cascade');
$table->integer('question_id')->nullable()->unsigned()->references('id')->on('questions')->onDelete('cascade');
$table->text('result')->nullable();
$table->timestamps();
$table->foreign('interview_id')->references('id')->on('interviews');
$table->foreign('answer_id')->references('id')->on('answers');
$table->foreign('question_id')->references('id')->on('questions');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('interview_answers');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateStudyTokensTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('study_tokens', function (Blueprint $table) {
$table->increments('id');
$table->integer('study_id')->nullable()->unsigned()->references('id')->on('studies')->onDelete('cascade');
$table->integer('token_id')->nullable()->unsigned()->references('id')->on('token')->onDelete('cascade');
$table->timestamps();
$table->foreign('study_id')->references('id')->on('studies');
$table->foreign('token_id')->references('id')->on('tokens');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('study_tokens');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSpecialpermissionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('permissions', function (Blueprint $table) {
$table->increments('id');
$table->string('name', 255);
$table->string('description', 255)->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('permissions');
}
}
This diff is collapsed.
<?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
$this->call(UsersTableSeeder::class);
$this->call(RolesTableSeeder::class);
$this->call(UserRoleTableSeeder::class);
$this->call(UsersProfilesSeeder::class);
$this->call(SpecialPermissionsSeeder::class);
$this->call(SortingTableSeeder::class);
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment