Skip to content
Permalink
Browse files

Merge pull request #62 from edersoares/new-menu

Atualiza migrations de menus
  • Loading branch information...
edersoares committed Jun 25, 2019
2 parents 911f621 + 727b0c3 commit 1bdf42b93fa8662e7334a4d84a91ac7b9563bcf6
Showing with 694 additions and 1,274 deletions.
  1. +233 −0 database/migrations/2018_09_01_000000_base_menus.php
  2. +11 −32 database/migrations/2018_09_20_160309_add_library_authors_report_menu.php
  3. +11 −31 database/migrations/2018_09_20_174045_add_library_publishers_report_menu.php
  4. +11 −31 database/migrations/2018_09_20_180044_add_library_works_report_menu.php
  5. +11 −25 database/migrations/2018_09_20_182201_add_library_clients_report_menu.php
  6. +11 −31 database/migrations/2018_09_20_183612_add_library_loans_report_menu.php
  7. +11 −31 database/migrations/2018_09_20_192454_add_library_devolutions_report_menu.php
  8. +11 −32 database/migrations/2018_09_20_194109_add_library_loan_receipt_report_menu.php
  9. +11 −32 database/migrations/2018_09_20_195808_add_library_devolution_receipt_report_menu.php
  10. +11 −31 database/migrations/2018_09_20_204252_add_schools_report_menu.php
  11. +11 −31 database/migrations/2018_09_20_210437_add_students_per_class_report_menu.php
  12. +11 −31 database/migrations/2018_09_21_124724_add_student_sheet_report_menu.php
  13. +11 −31 database/migrations/2018_09_21_131512_add_student_disciplinary_occurrence_report_menu.php
  14. +11 −31 database/migrations/2018_09_21_132429_add_registration_certificate_report_menu.php
  15. +11 −25 database/migrations/2018_09_21_133119_add_students_entrance_and_allocation_report_menu.php
  16. +11 −31 database/migrations/2018_09_21_133837_add_frequency_certificate_report_menu.php
  17. +11 −25 database/migrations/2018_09_21_134808_add_students_average_report_menu.php
  18. +11 −31 database/migrations/2018_09_21_135721_add_transference_certificate_report_menu.php
  19. +11 −25 database/migrations/2018_09_21_140514_add_conclusion_certificate_report_menu.php
  20. +11 −25 database/migrations/2018_09_21_142205_add_students_with_benefits_report_menu.php
  21. +11 −25 database/migrations/2018_09_21_163958_add_students_per_projects_report_menu.php
  22. +11 −25 database/migrations/2018_09_21_164700_add_students_with_disabilities_report_menu.php
  23. +11 −25 database/migrations/2018_09_21_170830_add_distribution_of_uniform_per_student_report_menu.php
  24. +11 −31 database/migrations/2018_09_21_172052_add_students_transferred_abandonment_report_menu.php
  25. +11 −31 database/migrations/2018_09_21_173535_add_teachers_and_courses_taught_by_class_report_menu.php
  26. +11 −31 database/migrations/2018_09_21_174226_add_servants_report_menu.php
  27. +11 −31 database/migrations/2018_09_21_182948_add_transportation_users_report_menu.php
  28. +11 −25 database/migrations/2018_09_21_184821_add_transportation_routes_report_menu.php
  29. +11 −25 database/migrations/2018_09_21_190139_add_drivers_report_menu.php
  30. +11 −25 database/migrations/2018_09_21_193817_add_conference_evaluations_faults_report_menu.php
  31. +11 −31 database/migrations/2018_09_21_194745_add_students_movement_report_menu.php
  32. +11 −25 database/migrations/2018_09_21_201536_add_educational_progress_and_procedures_report_menu.php
  33. +11 −31 database/migrations/2018_09_21_203129_add_teacher_report_card_report_menu.php
  34. +11 −31 database/migrations/2018_09_21_204155_add_report_card_report_menu.php
  35. +11 −7 database/migrations/2018_09_27_173007_add_class_record_book_menu.php
  36. +11 −31 database/migrations/2018_09_28_170910_add_school_history_report_menu.php
  37. +11 −31 database/migrations/2018_09_28_200522_add_vacancy_certificate_report_menu.php
  38. +11 −31 database/migrations/2018_10_02_224913_add_final_result_report_menu.php
  39. +11 −25 database/migrations/2018_10_06_012229_add_servant_sheet_report_menu.php
  40. +11 −25 database/migrations/2018_10_08_224610_add_class_average_comparative_report_menu.php
  41. +11 −25 database/migrations/2018_10_16_234638_add_age_distortion_in_serie_report_menu.php
  42. +21 −30 database/migrations/2018_10_19_104124_add_birthdays_report_menu.php
  43. +0 −115 database/migrations/2019_05_12_100000_migrate_reports_menu.php
@@ -0,0 +1,233 @@
<?php
use App\Menu;
use App\Process;
use Illuminate\Database\Migrations\Migration;
class BaseMenus extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Menu::query()->updateOrCreate([
'old' => 21126,
], [
'parent_id' => Menu::query()->where('old', Process::MENU_SCHOOL)->firstOrFail()->getKey(),
'title' => 'Relatórios',
'order' => 5,
'parent_old' => 15,
]);
Menu::query()->updateOrCreate([
'old' => 21127,
], [
'parent_id' => Menu::query()->where('old', Process::MENU_SCHOOL)->firstOrFail()->getKey(),
'title' => 'Documentos',
'order' => 6,
'parent_old' => 15,
]);
Menu::query()->updateOrCreate([
'old' => 999301,
], [
'parent_id' => Menu::query()->where('old', 21126)->firstOrFail()->getKey(),
'title' => 'Movimentações',
'order' => 2,
'parent_old' => 21126,
]);
Menu::query()->updateOrCreate([
'old' => 999922,
], [
'parent_id' => Menu::query()->where('old', 21126)->firstOrFail()->getKey(),
'title' => 'Lançamentos',
'order' => 3,
'parent_old' => 21126,
]);
Menu::query()->updateOrCreate([
'old' => 999300,
], [
'parent_id' => Menu::query()->where('old', 21126)->firstOrFail()->getKey(),
'title' => 'Cadastrais',
'order' => 4,
'parent_old' => 21126,
]);
Menu::query()->updateOrCreate([
'old' => 999923,
], [
'parent_id' => Menu::query()->where('old', 21126)->firstOrFail()->getKey(),
'title' => 'Matrículas',
'order' => 5,
'parent_old' => 21126,
]);
Menu::query()->updateOrCreate([
'old' => 999303,
], [
'parent_id' => Menu::query()->where('old', 21126)->firstOrFail()->getKey(),
'title' => 'Indicadores',
'order' => 6,
'parent_old' => 21126,
]);
Menu::query()->updateOrCreate([
'old' => 999400,
], [
'parent_id' => Menu::query()->where('old', 21127)->firstOrFail()->getKey(),
'title' => 'Atestados',
'order' => 0,
'parent_old' => 21127,
]);
Menu::query()->updateOrCreate([
'old' => 999450,
], [
'parent_id' => Menu::query()->where('old', 21127)->firstOrFail()->getKey(),
'title' => 'Boletins',
'order' => 2,
'parent_old' => 21127,
]);
Menu::query()->updateOrCreate([
'old' => 999925,
], [
'parent_id' => Menu::query()->where('old', 21127)->firstOrFail()->getKey(),
'title' => 'Resultados',
'order' => 3,
'parent_old' => 21127,
]);
Menu::query()->updateOrCreate([
'old' => 999861,
], [
'parent_id' => Menu::query()->where('old', 21127)->firstOrFail()->getKey(),
'title' => 'Fichas',
'order' => 8,
'parent_old' => 21127,
]);
Menu::query()->updateOrCreate([
'old' => 999460,
], [
'parent_id' => Menu::query()->where('old', 21127)->firstOrFail()->getKey(),
'title' => 'Históricos',
'order' => 9,
'parent_old' => 21127,
]);
Menu::query()->updateOrCreate([
'old' => 999500,
], [
'parent_id' => Menu::query()->where('old', 21127)->firstOrFail()->getKey(),
'title' => 'Registros',
'order' => 10,
'parent_old' => 21127,
]);
Menu::query()->updateOrCreate([
'old' => 999614,
], [
'parent_id' => Menu::query()->where('old', Process::MENU_LIBRARY)->firstOrFail()->getKey(),
'title' => 'Relatórios',
'order' => 3,
'parent_old' => 16,
]);
Menu::query()->updateOrCreate([
'old' => 999831,
], [
'parent_id' => Menu::query()->where('old', Process::MENU_LIBRARY)->firstOrFail()->getKey(),
'title' => 'Documentos',
'order' => 4,
'parent_old' => 16,
]);
Menu::query()->updateOrCreate([
'old' => 999905,
], [
'parent_id' => Menu::query()->where('old', 999614)->firstOrFail()->getKey(),
'title' => 'Cadastrais',
'order' => 1,
'parent_old' => 999614,
]);
Menu::query()->updateOrCreate([
'old' => 999906,
], [
'parent_id' => Menu::query()->where('old', 999614)->firstOrFail()->getKey(),
'title' => 'Movimentações',
'order' => 2,
'parent_old' => 999614,
]);
Menu::query()->updateOrCreate([
'old' => 999907,
], [
'parent_id' => Menu::query()->where('old', 999831)->firstOrFail()->getKey(),
'title' => 'Comprovantes',
'order' => 3,
'parent_old' => 999831,
]);
Menu::query()->updateOrCreate([
'old' => 20712,
], [
'parent_id' => Menu::query()->where('old', Process::MENU_TRANSPORT)->firstOrFail()->getKey(),
'title' => 'Relatórios',
'order' => 3,
'parent_old' => 17,
]);
Menu::query()->updateOrCreate([
'old' => 9998847,
], [
'parent_id' => Menu::query()->where('old', 20712)->firstOrFail()->getKey(),
'title' => 'Cadastrais',
'order' => 1,
'parent_old' => 20712,
]);
Menu::query()->updateOrCreate([
'old' => 999913,
], [
'parent_id' => Menu::query()->where('old', Process::MENU_EMPLOYEES)->firstOrFail()->getKey(),
'title' => 'Relatórios',
'order' => 2,
'parent_old' => 71,
]);
Menu::query()->updateOrCreate([
'old' => 999916,
], [
'parent_id' => Menu::query()->where('old', Process::MENU_EMPLOYEES)->firstOrFail()->getKey(),
'title' => 'Documentos',
'order' => 3,
'parent_old' => 71,
]);
Menu::query()->updateOrCreate([
'old' => 999914,
], [
'parent_id' => Menu::query()->where('old', 999913)->firstOrFail()->getKey(),
'title' => 'Cadastrais',
'order' => 1,
'parent_old' => 999913,
]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Menu::query()->where('old', 999914)->delete();
Menu::query()->where('old', 999916)->delete();
Menu::query()->where('old', 999913)->delete();
Menu::query()->where('old', 9998847)->delete();
Menu::query()->where('old', 20712)->delete();
Menu::query()->where('old', 999907)->delete();
Menu::query()->where('old', 999906)->delete();
Menu::query()->where('old', 999905)->delete();
Menu::query()->where('old', 999831)->delete();
Menu::query()->where('old', 999614)->delete();
Menu::query()->where('old', 999500)->delete();
Menu::query()->where('old', 999460)->delete();
Menu::query()->where('old', 999861)->delete();
Menu::query()->where('old', 999925)->delete();
Menu::query()->where('old', 999450)->delete();
Menu::query()->where('old', 999400)->delete();
Menu::query()->where('old', 999303)->delete();
Menu::query()->where('old', 999923)->delete();
Menu::query()->where('old', 999300)->delete();
Menu::query()->where('old', 999922)->delete();
Menu::query()->where('old', 999301)->delete();
Menu::query()->where('old', 21127)->delete();
Menu::query()->where('old', 21126)->delete();
}
}
@@ -1,7 +1,7 @@
<?php
use App\Menu;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
class AddLibraryAuthorsReportMenu extends Migration
{
@@ -12,21 +12,15 @@ class AddLibraryAuthorsReportMenu extends Migration
*/
public function up()
{
DB::unprepared(
'
INSERT INTO portal.menu_submenu (cod_menu_submenu, ref_cod_menu_menu, cod_sistema, nm_submenu, arquivo, title, nivel)
VALUES (999615, 57, 2, \'Relatório de autores\', \'module/Reports/LibraryAuthors\', null, 3);
INSERT INTO pmicontrolesis.menu (cod_menu, ref_cod_menu_submenu, ref_cod_menu_pai, tt_menu, ord_menu, caminho, alvo, suprime_menu, ref_cod_tutormenu, ref_cod_ico, tipo_menu)
VALUES (999615, 999615, 999905, \'Relatório de autores\', 1, \'module/Reports/LibraryAuthors\', \'_self\', 1, 16, 1, null);
INSERT INTO pmieducar.menu_tipo_usuario (ref_cod_tipo_usuario, ref_cod_menu_submenu, cadastra, visualiza, exclui)
VALUES (1, 999615, 1, 0, 1);
INSERT INTO portal.menu_funcionario (ref_ref_cod_pessoa_fj, cadastra, exclui, ref_cod_menu_submenu)
VALUES (1, 0, 0, 999615);
'
);
Menu::query()->create([
'parent_id' => Menu::query()->where('old', 999905)->firstOrFail()->getKey(),
'title' => 'Relatório de autores',
'link' => '/module/Reports/LibraryAuthors',
'order' => 1,
'parent_old' => 999905,
'old' => 999615,
'process' => 999615,
]);
}
/**
@@ -36,21 +30,6 @@ public function up()
*/
public function down()
{
DB::unprepared(
'
DELETE FROM portal.menu_funcionario
WHERE ref_cod_menu_submenu = 999615;
DELETE FROM pmieducar.menu_tipo_usuario
WHERE ref_cod_menu_submenu = 999615;
DELETE FROM pmicontrolesis.menu
WHERE cod_menu = 999615;
DELETE FROM portal.menu_submenu
WHERE cod_menu_submenu = 999615;
'
);
Menu::query()->where('process', 999615)->delete();
}
}
@@ -1,7 +1,7 @@
<?php
use App\Menu;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
class AddLibraryPublishersReportMenu extends Migration
{
@@ -12,21 +12,15 @@ class AddLibraryPublishersReportMenu extends Migration
*/
public function up()
{
DB::unprepared(
'
INSERT INTO portal.menu_submenu (cod_menu_submenu, ref_cod_menu_menu, cod_sistema, nm_submenu, arquivo, title, nivel)
VALUES (999616, 57, 2, \'Relatório de editoras\', \'module/Reports/LibraryPublishers\', null, 3);
INSERT INTO pmicontrolesis.menu (cod_menu, ref_cod_menu_submenu, ref_cod_menu_pai, tt_menu, ord_menu, caminho, alvo, suprime_menu, ref_cod_tutormenu, ref_cod_ico, tipo_menu)
VALUES (999616, 999616, 999905, \'Relatório de editoras\', 2, \'module/Reports/LibraryPublishers\', \'_self\', 1, 16, 1, null);
INSERT INTO pmieducar.menu_tipo_usuario (ref_cod_tipo_usuario, ref_cod_menu_submenu, cadastra, visualiza, exclui)
VALUES (1, 999616, 1, 0, 1);
INSERT INTO portal.menu_funcionario (ref_ref_cod_pessoa_fj, cadastra, exclui, ref_cod_menu_submenu)
VALUES (1, 0, 0, 999616);
'
);
Menu::query()->create([
'parent_id' => Menu::query()->where('old', 999905)->firstOrFail()->getKey(),
'title' => 'Relatório de editoras',
'description' => null,
'link' => '/module/Reports/LibraryPublishers',
'order' => 2,
'old' => 999616,
'process' => 999616,
]);
}
/**
@@ -36,20 +30,6 @@ public function up()
*/
public function down()
{
DB::unprepared(
'
DELETE FROM portal.menu_funcionario
WHERE ref_cod_menu_submenu = 999616;
DELETE FROM pmieducar.menu_tipo_usuario
WHERE ref_cod_menu_submenu = 999616;
DELETE FROM pmicontrolesis.menu
WHERE cod_menu = 999616;
DELETE FROM portal.menu_submenu
WHERE cod_menu_submenu = 999616;
'
);
Menu::query()->where('process', 999616)->delete();
}
}

0 comments on commit 1bdf42b

Please sign in to comment.
You can’t perform that action at this time.