Unverified Commit 5250d353 authored by Gabriel Antônio da Silva's avatar Gabriel Antônio da Silva Committed by GitHub
Browse files

Merge pull request #5 from lmts-ufape/submeter

Funcionalidades básicas
parents 5de5a599 96ffb16f
...@@ -16,18 +16,18 @@ class ChavesEstrangeiras extends Migration ...@@ -16,18 +16,18 @@ class ChavesEstrangeiras extends Migration
//------------------------------------------------------------------------ //------------------------------------------------------------------------
Schema::table('areas', function (Blueprint $table) { // Schema::table('areas', function (Blueprint $table) {
$table->foreign('eventoId')->references('id')->on('eventos'); // $table->foreign('eventoId')->references('id')->on('eventos');
}); // });
//------------------------------------------------------------------------ // //------------------------------------------------------------------------
Schema::table('area_modalidades', function (Blueprint $table) { // Schema::table('area_modalidades', function (Blueprint $table) {
$table->foreign('areaId')->references('id')->on('areas'); // $table->foreign('areaId')->references('id')->on('areas');
}); // });
Schema::table('area_modalidades', function (Blueprint $table) { // Schema::table('area_modalidades', function (Blueprint $table) {
$table->foreign('modalidadeId')->references('id')->on('modalidades'); // $table->foreign('modalidadeId')->references('id')->on('modalidades');
}); // });
//------------------------------------------------------------------------ //------------------------------------------------------------------------
...@@ -61,9 +61,7 @@ class ChavesEstrangeiras extends Migration ...@@ -61,9 +61,7 @@ class ChavesEstrangeiras extends Migration
//------------------------------------------------------------------------ //------------------------------------------------------------------------
Schema::table('eventos', function (Blueprint $table) {
$table->foreign('enderecoId')->references('id')->on('enderecos');
});
Schema::table('eventos', function (Blueprint $table) { Schema::table('eventos', function (Blueprint $table) {
$table->foreign('coordenadorId')->references('id')->on('users'); $table->foreign('coordenadorId')->references('id')->on('users');
}); });
...@@ -85,9 +83,9 @@ class ChavesEstrangeiras extends Migration ...@@ -85,9 +83,9 @@ class ChavesEstrangeiras extends Migration
//------------------------------------------------------------------------ //------------------------------------------------------------------------
Schema::table('pertences', function (Blueprint $table) { // Schema::table('pertences', function (Blueprint $table) {
$table->foreign('areaId')->references('id')->on('areas'); // $table->foreign('areaId')->references('id')->on('areas');
}); // });
Schema::table('pertences', function (Blueprint $table) { Schema::table('pertences', function (Blueprint $table) {
$table->foreign('revisorId')->references('id')->on('users'); $table->foreign('revisorId')->references('id')->on('users');
}); });
...@@ -103,39 +101,39 @@ class ChavesEstrangeiras extends Migration ...@@ -103,39 +101,39 @@ class ChavesEstrangeiras extends Migration
//------------------------------------------------------------------------ //------------------------------------------------------------------------
Schema::table('trabalhos', function (Blueprint $table) { // Schema::table('trabalhos', function (Blueprint $table) {
$table->foreign('modalidadeId')->references('id')->on('modalidades'); // $table->foreign('modalidadeId')->references('id')->on('modalidades');
}); // });
Schema::table('trabalhos', function (Blueprint $table) { // Schema::table('trabalhos', function (Blueprint $table) {
$table->foreign('areaId')->references('id')->on('areas'); // $table->foreign('areaId')->references('id')->on('areas');
}); // });
Schema::table('trabalhos', function (Blueprint $table) { // Schema::table('trabalhos', function (Blueprint $table) {
$table->foreign('autorId')->references('id')->on('users'); // $table->foreign('autorId')->references('id')->on('users');
}); // });
Schema::table('trabalhos', function (Blueprint $table) { // Schema::table('trabalhos', function (Blueprint $table) {
$table->foreign('eventoId')->references('id')->on('eventos'); // $table->foreign('eventoId')->references('id')->on('eventos');
}); // });
//------------------------------------------------------------------------ //------------------------------------------------------------------------
Schema::table('users', function (Blueprint $table) { // Schema::table('users', function (Blueprint $table) {
$table->foreign('enderecoId')->references('id')->on('enderecos'); // $table->foreign('enderecoId')->references('id')->on('enderecos');
}); // });
//------------------------------------------------------------------------ //------------------------------------------------------------------------
Schema::table('revisors', function (Blueprint $table) { // Schema::table('revisors', function (Blueprint $table) {
$table->foreign('revisorId')->references('id')->on('users'); // $table->foreign('revisorId')->references('id')->on('users');
}); // });
Schema::table('revisors', function (Blueprint $table) { // Schema::table('revisors', function (Blueprint $table) {
$table->foreign('eventoId')->references('id')->on('eventos'); // $table->foreign('eventoId')->references('id')->on('eventos');
}); // });
Schema::table('revisors', function (Blueprint $table) { // Schema::table('revisors', function (Blueprint $table) {
$table->foreign('areaId')->references('id')->on('areas'); // $table->foreign('areaId')->references('id')->on('areas');
}); // });
Schema::table('eventos',function (Blueprint $table){ // Schema::table('eventos',function (Blueprint $table){
$table->foreign('coordComissaoId')->references('id')->on('users'); // $table->foreign('coordComissaoId')->references('id')->on('users');
}); // });
//------------------------------------------------------------------------ //------------------------------------------------------------------------
} }
......
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAdministradorsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('administradors', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('matricula')->unique();
$table->timestamps();
$table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('administradors');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProponentesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('proponentes', function (Blueprint $table) {
$table->bigIncrements('id');
//$table->string('CPF');
$table->string('SIAPE');
//$table->string('email')->unique();
$table->string('cargo');
$table->string('vinculo');
$table->string('titulacaoMaxima');
$table->string('anoTitulacao');
$table->string('grandeArea');
$table->string('area');
$table->string('subArea');
$table->string('bolsistaProdutividade');
$table->string('nivel');
$table->string('linkLattes');
$table->timestamps();
$table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('proponentes');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePlanoTrabalhosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('plano_trabalhos', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('titulo');
$table->string('anexoPlanoTrabalho');
$table->timestamps();
$table->unsignedBigInteger('trabalho_id');
$table->foreign('trabalho_id')->references('id')->on('trabalhos');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('plano_trabalhos');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAdministradorResponsavelsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('administrador_responsavels', function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
$table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('administrador_responsavels');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateGrandeAreasTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('grande_areas', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('nome');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('grande_areas');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSubAreasTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sub_areas', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string("nome");
$table->timestamps();
$table->unsignedBigInteger('area_id');
$table->foreign('area_id')->references('id')->on('areas');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sub_areas');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFuncaoParticipantesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('funcao_participantes', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('nome');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('funcao_participantes');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCoordenadorComissaosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('coordenador_comissaos', function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
$table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('coordenador_comissaos');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAvaliadorsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('avaliadors', function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
$table->unsignedBigInteger('user_id')->nullable();
$table->foreign('user_id')->references('id')->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('avaliadors');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateParticipantesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('participantes', function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
$table->unsignedBigInteger('user_id')->nullable();
$table->foreign('user_id')->references('id')->on('users');
$table->unsignedBigInteger('trabalho_id')->nullable();
$table->foreign('trabalho_id')->references('id')->on('trabalhos');
$table->unsignedBigInteger('funcao_participante_id')->nullable();
$table->foreign('funcao_participante_id')->references('id')->on('funcao_participantes');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('participantes');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddForeignToTrabalhosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('trabalhos', function (Blueprint $table) {
$table->foreign('grande_area_id')->references('id')->on('grande_areas');
$table->foreign('area_id')->references('id')->on('areas');
$table->foreign('sub_area_id')->references('id')->on('sub_areas');
$table->foreign('evento_id')->references('id')->on('eventos');
$table->foreign('coordenador_id')->references('id')->on('coordenador_comissaos');
//$table->foreignId('user_id')->constrained();
// $table->integer('coordenador');
// $table->integer('grandeArea_id');
// $table->integer('area');
// $table->integer('subArea');
// $table->integer('eventoId');
// $table->integer('proponente_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('trabalhos', function (Blueprint $table) {
//
});
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTrabalhosParticipantesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('trabalho_participante', function (Blueprint $table) {
$table->unsignedBigInteger('trabalho_id');
$table->unsignedBigInteger('participante_id');
$table->foreign('trabalho_id')->references('id')->on('trabalhos');
$table->foreign('participante_id')->references('id')->on('participantes');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('trabalho_participante');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTrabalhosProponentesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('trabalho_proponente', function (Blueprint $table) {
$table->unsignedBigInteger('trabalho_id');
$table->unsignedBigInteger('proponente_id');
$table->foreign('trabalho_id')->references('id')->on('trabalhos');
$table->foreign('proponente_id')->references('id')->on('proponentes');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('trabalho_proponente');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddGrandeAreasAreaTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('areas', function (Blueprint $table) {
$table->foreign('grande_area_id')->references('id')->on('grande_areas');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('areas', function (Blueprint $table) {
//
});
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAvaliadorsTrabalhosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('avaliador_trabalho', function (Blueprint $table) {
$table->unsignedBigInteger('trabalho_id');
$table->unsignedBigInteger('avaliador_id');
$table->foreign('trabalho_id')->references('id')->on('trabalhos');
$table->foreign('avaliador_id')->references('id')->on('avaliadors');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('avaliador_trabalho');
}
}
<?php
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class AdministradorResponsavelSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$user_id = DB::table('users')->where('name','AdministradorResponsavel1')->pluck('id');
DB::table('administrador_responsavels')->insert([
'user_id' => $user_id[0],
]);
$user_id = DB::table('users')->where('name','AdministradorResponsavel2')->pluck('id');
DB::table('administrador_responsavels')->insert([
'user_id' => $user_id[0],
]);
}
}
<?php
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class AdministradorSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$user_id = DB::table('users')->where('name','Administrador')->pluck('id');
DB::table('administradors')->insert([
'matricula'=>'123456789',
'user_id' => $user_id[0],
]);
}
}
<?php
use Illuminate\Database\Seeder;
class AreaSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('areas')->insert([
'nome'=>'Matemática',
'grande_area_id' => '1'
]);
DB::table('areas')->insert([
'nome'=>'Probabilidade e Estatística',
'grande_area_id' => '1'
]);
DB::table('areas')->insert([
'nome'=>'Ciência da Computação',
'grande_area_id' => '1'
]);
DB::table('areas')->insert([
'nome'=>'Astronomia',
'grande_area_id' => '1'
]);
DB::table('areas')->insert([
'nome'=>'Física',
'grande_area_id' => '1'
]);
DB::table('areas')->insert([
'nome'=>'Química',
'grande_area_id' => '1'
]);
DB::table('areas')->insert([
'nome'=>'GeoCiências',
'grande_area_id' => '1'
]);
DB::table('areas')->insert([
'nome'=>'Oceanografia',
'grande_area_id' => '1'
]);
// Ciências Biológicas ----------------------
DB::table('areas')->insert([
'nome'=>'Biologia Geral',
'grande_area_id' => '2'
]);
DB::table('areas')->insert([
'nome'=>'Genética',
'grande_area_id' => '2'
]);
DB::table('areas')->insert([
'nome'=>'Botânica',
'grande_area_id' => '2'
]);
DB::table('areas')->insert([
'nome'=>'Zoologia',
'grande_area_id' => '2'
]);
DB::table('areas')->insert([
'nome'=>'Ecologia',
'grande_area_id' => '2'
]);
DB::table('areas')->insert([
'nome'=>'Morfologia',
'grande_area_id' => '2'
]);
DB::table('areas')->insert([
'nome'=>'Bioquímica',
'grande_area_id' => '2'
]);
DB::table('areas')->insert([
'nome'=>'Fisiologia',
'grande_area_id' => '2'
]);
DB::table('areas')->insert([
'nome'=>'Biofísica',
'grande_area_id' => '2'
]);
DB::table('areas')->insert([
'nome'=>'Farmacologia',
'grande_area_id' => '2'
]);
DB::table('areas')->insert([
'nome'=>'Imunologia',
'grande_area_id' => '2'
]);
DB::table('areas')->insert([
'nome'=>'Microbiologia',
'grande_area_id' => '2'
]);
DB::table('areas')->insert([
'nome'=>'Parasitologia',
'grande_area_id' => '2'
]);
//Engenharias --------------------
DB::table('areas')->insert([
'nome'=>'Engenharia Civil',
'grande_area_id' => '3'
]);
// Ciências da Saúde -----------------
DB::table('areas')->insert([
'nome'=>'Medicina',
'grande_area_id' => '4'
]);
//Ciências Agrárias ------------------
DB::table('areas')->insert([
'nome'=>'Agronomia',
'grande_area_id' => '5'
]);
//Ciências Sociais Aplicadas ----------
DB::table('areas')->insert([
'nome'=>'Direito',
'grande_area_id' => '6'
]);
//Ciências Humanas ----------------------
DB::table('areas')->insert([
'nome'=>'Filosofia',
'grande_area_id' => '7'
]);
//Lingüística, Letras e Artes-----------
DB::table('areas')->insert([
'nome'=>'Lingüística',
'grande_area_id' => '8'
]);
}
}
<?php
use Illuminate\Database\Seeder;
class CoordenadorComissaoSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$user_id = DB::table('users')->where('name','Coordenador1')->pluck('id');
DB::table('coordenador_comissaos')->insert([
'user_id' => $user_id[0],
]);
$user_id = DB::table('users')->where('name','Coordenador2')->pluck('id');
DB::table('coordenador_comissaos')->insert([
'user_id' => $user_id[0],
]);
}
}
Markdown is supported
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