PHP Method Schema::rename, someline-starter Code Examples

This page contains top rated real world PHP examples of method Schema::rename from package someline-starter extracted from open source projects. You can rate examples to help us improve the quality of examples

rename() public static method

Rename a table on the schema.
public static rename ( string $from, string $to ) : Illuminate\Database\Schema\Blueprint
$from string
$to string
return Illuminate\Database\Schema\Blueprint
Example #1
Show file File: ObjectController.php Project: joshreisner/avalon
0
 public function update($object_name)
 {
     //rename table if necessary
     $object = DB::table(DB_OBJECTS)->where('name', $object_name)->first();
     $new_name = Str::slug(Input::get('name'), '_');
     if ($object->name != $new_name) {
         Schema::rename($object->name, $new_name);
     }
     //enforce predence always ascending
     $order_by = Input::get('order_by');
     $direction = Input::get('direction');
     if ($order_by == 'precedence') {
         $direction = 'asc';
     }
     //not sure why it's necessary, doesn't like empty value all of a sudden
     $group_by_field = Input::has('group_by_field') ? Input::get('group_by_field') : null;
     //linked objects
     DB::table(DB_OBJECT_LINKS)->where('object_id', $object->id)->delete();
     if (Input::has('related_objects')) {
         foreach (Input::get('related_objects') as $linked_id) {
             DB::table(DB_OBJECT_LINKS)->insert(['object_id' => $object->id, 'linked_id' => $linked_id]);
         }
     }
     //update objects table
     DB::table(DB_OBJECTS)->where('id', $object->id)->update(['title' => Input::get('title'), 'name' => $new_name, 'model' => Input::get('model'), 'url' => Input::get('url'), 'order_by' => $order_by, 'direction' => $direction, 'singleton' => Input::has('singleton') ? 1 : 0, 'can_see' => Input::has('can_see') ? 1 : 0, 'can_create' => Input::has('can_create') ? 1 : 0, 'can_edit' => Input::has('can_edit') ? 1 : 0, 'list_grouping' => Input::get('list_grouping'), 'group_by_field' => $group_by_field, 'list_help' => trim(Input::get('list_help')), 'form_help' => trim(Input::get('form_help'))]);
     self::saveSchema();
     return Redirect::action('InstanceController@index', $new_name);
 }
Example #2
Show file File: 2015_05_24_113910_drop_versions.php Project: elazar/symposium
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     // No data preservation on the "down" side of this one.
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     foreach (['favorites', 'conferences', 'submissions', 'talk_revisions', 'talks'] as $table) {
         DB::table($table)->truncate();
     }
     DB::statement('SET FOREIGN_KEY_CHECKS = 1');
     Schema::table('talks', function (Blueprint $table) {
         $table->string('title')->unique();
         $table->text('description');
     });
     Schema::create('talk_versions', function (Blueprint $table) {
         $table->string('id', 36)->unique();
         $table->string('nickname', 150);
         $table->timestamps();
         $table->string('talk_id', 36);
         $table->foreign('talk_id')->references('id')->on('talks')->onDelete('cascade');
     });
     Schema::rename('talk_revisions', 'talk_version_revisions');
     Schema::table('talk_version_revisions', function (Blueprint $table) {
         $table->dropForeign('talk_revisions_talk_id_foreign');
         $table->dropColumn('talk_id');
         $table->string('talk_version_id', 36);
         $table->foreign('talk_version_id')->references('id')->on('talk_versions')->onDelete('cascade');
     });
     Schema::table('submissions', function (Blueprint $table) {
         $table->dropForeign('submissions_talk_revision_id_foreign');
         $table->renameColumn('talk_revision_id', 'talk_version_revision_id');
         $table->foreign('talk_version_revision_id')->references('id')->on('talk_version_revisions')->onDelete('cascade');
     });
 }
Example #3
Show file File: 2014_08_01_065531_rename-partners-to-beneficiaries.php Project: npmweb/service-opportunities
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     // break relations
     Schema::table('opportunities', function ($table) {
         $table->dropForeign('opportunities_beneficiary_id_foreign');
     });
     // rename tables and fields
     Schema::rename('beneficiaries', 'partners');
     Schema::rename('beneficiary_attributes', 'partner_attributes');
     Schema::table('partner_attributes', function ($table) {
         $table->renameColumn("beneficiary_id", "partner_id");
     });
     Schema::table('opportunities', function ($table) {
         $table->renameColumn("beneficiary_id", "partner_id");
     });
     Schema::table('attributes', function ($table) {
         $table->dropColumn('for');
     });
     Schema::table('attributes', function ($table) {
         $table->enum('for', ['partner,opportunity']);
     });
     Schema::table('configs', function ($table) {
         $table->renameColumn('show_filter_beneficiary', 'show_filter_partner');
     });
     // remake relations
     Schema::table('opportunities', function ($table) {
         $table->foreign('partner_id')->references('id')->on('partners');
     });
     Schema::table('partner_attributes', function ($table) {
         $table->foreign('partner_id')->references('id')->on('partners');
     });
 }
Example #4
Show file File: 2014_07_01_181718_drop_unused_user_fields.php Project: iaincollins/madison
0
 public function downSQLite()
 {
     DB::statement('PRAGMA foreign_keys = OFF');
     Schema::create('users_temp', function ($table) {
         $table->engine = "InnoDB";
         $table->increments('id');
         $table->string('email')->unique();
         $table->string('password', 100);
         $table->string('fname');
         $table->string('lname');
         $table->string('phone')->nullable();
         $table->integer('org_id')->unsigned()->nullable();
         $table->string('position')->nullable();
         $table->string('location')->nullable();
         $table->string('url')->nullable();
         $table->string('token', 25);
         $table->text('likes')->nullable();
         $table->text('dislikes')->nullable();
         $table->text('flags')->nullable();
         $table->timestamp('last_login')->nullable();
         $table->timestamps();
         //Set foreign keys
         $table->foreign('org_id')->references('id')->on('organizations')->on_delete('set null');
     });
     DB::statement('INSERT INTO `users_temp` (`id`, `email`, `password`, `fname`, `lname`, `phone`, `org_id`, `position`, `location`, `url`, `token`, `likes`, `dislikes`, `flags`, `last_login`, `created_at`, `updated_at`) SELECT `id`, `email`, `password`, `fname`, `lname`, `phone`, `org_id`, `position`, `location`, `url`, `token`, `likes`, `dislikes`, `flags`, `last_login`, `created_at`, `updated_at` FROM `users`');
     Schema::drop('users');
     Schema::rename('users_temp', 'users');
     DB::statement('PRAGMA foreign_keys = ON');
 }
Example #5
Show file File: 2014_03_18_071119_drop_annotation_meta_columns.php Project: krues8dr/madison
0
 public function downSQLite()
 {
     DB::statement('PRAGMA foreign_keys = OFF');
     Schema::create('annotations_temp', function ($table) {
         $table->engine = "InnoDB";
         $table->increments('id');
         $table->string('search_id');
         $table->integer('user_id')->unsigned();
         $table->integer('doc')->unsigned();
         $table->string('quote');
         $table->string('text');
         $table->string('uri');
         $table->integer('likes');
         $table->integer('dislikes');
         $table->integer('flags');
         $table->timestamps();
         $table->foreign('user_id')->references('id')->on('users');
         $table->foreign('doc')->references('id')->on('docs');
         $table->unique('search_id');
     });
     DB::statement('INSERT INTO `annotations_temp` (`id`, `search_id`, `user_id`, `doc`, `quote`, `text`, `uri`, `created_at`, `updated_at`) SELECT `id`, `search_id`, `user_id`, `doc`, `quote`, `text`, `uri`, `created_at`, `updated_at` FROM `annotations`');
     Schema::drop('annotations');
     Schema::rename('annotations_temp', 'annotations');
     DB::statement('PRAGMA foreign_keys = ON');
 }
Example #6
Show file File: 2014_09_02_135343_rename_promo_url_table.php Project: coandacms/coanda-core
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::rename('redirecturls', 'promourls');
     Schema::table('promourls', function ($table) {
         $table->dropColumn('redirect_type');
     });
 }
Example #7
Show file File: 2015_07_22_123255_alter_farmacia_asos_add_ficha_id.php Project: kuell/buriti
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::rename('farmacia.asos', 'farmacia_asos');
     DB::statement('alter table farmacia.farmacia_asos set schema public');
     Schema::table('farmacia_asos', function (Blueprint $table) {
         $table->dropColumn('ficha_id');
     });
 }
Example #8
Show file File: 2015_12_05_034647_fix_session_fields.php Project: konato-events/web
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::table('sessions', function (Blueprint $table) {
         $table->renameColumn('begin', 'time');
         $table->dropColumn('end');
     });
     Schema::rename('session_speaker', 'speaker_session');
 }
Example #9
Show file File: 2014_01_28_173317_rename_trees_table_to_dropboxes.php Project: andrewpurkett/demo-dropbox-rest-service
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::table('dropboxes', function ($table) {
         $table->renameColumn('dropbox_id', 'user_id');
         $table->renameColumn('dropbox_token', 'token');
     });
     Schema::rename('dropboxes', 'trees');
 }
Example #10
Show file File: 2015_09_22_122128_rename_setting_translatable.php Project: manogi/gfw-qm
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::rename('setting_translateables', 'setting_translatables');
     Schema::rename('setting_translateable_translations', 'setting_translatable_translations');
     Schema::table('setting_translatable_translations', function (Blueprint $table) {
         $table->renameColumn('setting_translateable_id', 'setting_translatable_id');
     });
 }
Example #11
Show file File: 2016_01_18_000000_import_shiphed_database.php Project: paulboco/laravel
0
 /**
  * Rename tables.
  *
  * @return void
  */
 private function renameTables()
 {
     foreach ($this->renameTables as $table) {
         Schema::rename($table, str_replace('rpm_', '', $table));
     }
     Schema::rename('rentals', 'properties');
     Schema::rename('rental_utilities', 'property_utilities');
 }
Example #12
Show file File: 2016_03_01_162651_update_files_to_images.php Project: philsquare/laramanager
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::rename('images', 'files');
     Schema::table('files', function (Blueprint $table) {
         $table->dropColumn('size');
         $table->enum('type', ['doc', 'image', 'pdf']);
     });
 }
Example #13
Show file File: 2016_01_10_233059_create_statements_table.php Project: daninoz/kontas-server
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::rename('statements', 'credit_card_dates');
     Schema::table('credit_card_dates', function (Blueprint $table) {
         $table->drop('has_real_dates');
         $table->drop('period');
     });
 }
Example #14
Show file File: 2015_08_13_120934_rename_product_categories_pivot_table.php Project: rondarby/laracomm
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::rename('categories_products', 'product_categories');
     Schema::table('product_categories', function (Blueprint $table) {
         $table->renameColumn('products_id', 'product_id');
         $table->renameColumn('categories_id', 'category_id');
     });
 }
Example #15
Show file File: 2014_08_11_194536_user_anime_library.php Project: shaikhatik0786/Masteranime
0
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::dropIfExists('anime_favorites');
     if (Schema::hasTable('lastwatched_anime')) {
         if (Schema::hasColumn('lastwatched_anime', 'created_at')) {
             Schema::table('lastwatched_anime', function ($table) {
                 $table->dropColumn('created_at');
             });
         }
         if (!Schema::hasColumn('lastwatched_anime', 'last_watched_episode')) {
             if (Schema::hasColumn('lastwatched_anime', 'episode')) {
                 Schema::table('lastwatched_anime', function ($table) {
                     $table->renameColumn('episode', 'last_watched_episode')->nullable()->default(null);
                 });
             } else {
                 Schema::table('lastwatched_anime', function ($table) {
                     $table->string('last_watched_episode', 11)->nullable();
                 });
             }
         }
         if (!Schema::hasColumn('lastwatched_anime', 'last_watched_time')) {
             if (Schema::hasColumn('lastwatched_anime', 'updated_at')) {
                 Schema::table('lastwatched_anime', function ($table) {
                     $table->renameColumn('updated_at', 'last_watched_time')->nullable()->default(null);
                 });
             } else {
                 Schema::table('lastwatched_anime', function ($table) {
                     $table->timestamp('last_watched_time')->nullable();
                 });
             }
         }
         if (!Schema::hasColumn('lastwatched_anime', 'is_fav')) {
             Schema::table('lastwatched_anime', function ($table) {
                 $table->tinyInteger('library_status')->default(0);
             });
         }
         if (!Schema::hasColumn('lastwatched_anime', 'library_status')) {
             Schema::table('lastwatched_anime', function ($table) {
                 $table->tinyInteger('library_status')->default(0);
             });
         }
         Schema::rename('lastwatched_anime', 'user_anime_library');
         Schema::table('user_anime_library', function ($table) {
             $table->timestamps();
         });
     } else {
         Schema::create('user_anime_library', function ($table) {
             $table->increments('id');
             $table->integer('user_id');
             $table->integer('anime_id');
             $table->boolean('is_fav')->default(false);
             $table->tinyInteger('library_status')->default(0);
             $table->string('last_watched_episode', 11)->nullable()->default(null);
             $table->timestamp('last_watched_time')->nullable()->default(null);
             $table->timestamps();
         });
     }
 }
Example #16
Show file File: 2015_09_14_153301_alter_farmacia_exames_exames_add_validade.php Project: kuell/buriti
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::table('farmacia.aso_exames', function (Blueprint $table) {
         $table->dropColumn('exame_id');
         $table->dropColumn('validade');
     });
     DB::statement('alter table farmacia.aso_exames set schema public');
     Schema::rename('aso_exames', 'farmacia_exames');
 }
Example #17
Show file File: 2015_06_30_142357_alter_farmacia_ocorrencia_add_sesmt.php Project: kuell/buriti
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::table('farmacia.ocorrencias', function (Blueprint $table) {
         $table->dropColumn('sesmt');
     });
     DB::statement('alter table farmacia.ocorrencias set schema public');
     DB::statement('alter table farmacia.ocorrencia_medicacaos set schema public');
     Schema::rename('ocorrencias', 'farmacia_ocorrencias');
     Schema::rename('ocorrencia_medicacaos', 'farmacia_ocorrencia_medicacaos');
 }
Example #18
Show file File: 2014_11_12_174325_rename_datasources_table.php Project: schlos/GreenAlert
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     //
     Schema::rename('datasources', 'data_sources');
     Schema::table('data_source_syncs', function ($table) {
         $table->renameColumn('datasource_id', 'data_source_id');
     });
     Schema::table('projects', function ($table) {
         $table->renameColumn('datasource_id', 'data_source_id');
     });
 }
Example #19
Show file File: 2013_11_28_205454_add_id_to_tags_table.php Project: sekouzed/core
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::create('tags_old', function ($table) {
         $table->integer('post_id');
         $table->string('tag');
         $table->unique(array('post_id', 'tag'));
     });
     DB::statement('INSERT INTO tags_old(`post_id`, `tag`) SELECT `post_id`, `tag` FROM tags');
     Schema::drop('tags');
     Schema::rename('tags_old', 'tags');
 }
Example #20
Show file File: 2016_09_01_123936_imageable_refactor.php Project: despark/ignicms
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::rename('images', 'imageables');
     Schema::table('imageables', function (Blueprint $table) {
         $table->renameColumn('resource_id', 'imageable_id');
         $table->renameColumn('resource_model', 'imageable_type');
         $table->renameColumn('original_image', 'file');
         $table->dropColumn('retina_factor');
         $table->dropColumn('image_type');
         $table->integer('orientation')->after('original_image');
     });
 }
Example #21
Show file File: 2016_04_20_192649_create_joint_permissions_table.php Project: ssddanbrown/bookstack
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::drop('joint_permissions');
     Schema::rename('role_permissions', 'permissions');
     Schema::rename('entity_permissions', 'restrictions');
     // Delete the public role
     DB::table('roles')->where('system_name', '=', 'public')->delete();
     Schema::table('roles', function (Blueprint $table) {
         $table->dropColumn('system_name');
         $table->dropColumn('hidden');
     });
 }
Example #22
Show file File: 2013_11_19_135437_rename_input_tables.php Project: tdt/input
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     // Undo the renaming of the tables
     Schema::rename('input_csvextract', 'csvextract');
     Schema::rename('input_xmlextract', 'xmlextract');
     Schema::rename('input_jsonextract', 'jsonextract');
     Schema::rename('input_shpextract', 'shpextract');
     Schema::rename('input_rdfmap', 'rdfmap');
     Schema::rename('input_sparqlload', 'sparqlload');
     Schema::rename('input_tdtpublish', 'tdtpublisher');
     Schema::rename('input_job', 'job');
     Schema::rename('input_graph', 'graphs');
 }
Example #23
Show file File: 2016_03_20_153401_updateactivity.php Project: saproto/saproto
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::table('activities', function (Blueprint $table) {
         $table->dropColumn('organizing_commitee');
     });
     Schema::table('committees_activities', function (Blueprint $table) {
         $table->renameColumn('activity_id', 'event_id');
     });
     Schema::rename('committees_activities', 'committees_events');
     Schema::table('activities_users', function (Blueprint $table) {
         $table->renameColumn('committees_activities_id', 'committees_events_id');
     });
 }
Example #24
Show file File: 2013_09_20_130908_fix_application_reference_tables.php Project: sgh1986915/laravel-bizgym
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     // Restore non-standard convention migration
     if (Schema::hasTable('user_password_reminders')) {
         Schema::rename('user_password_reminders', 'password_reminders');
     }
     if (Schema::hasTable('user_social')) {
         Schema::rename('user_social', 'users_social');
     }
     if (Schema::hasTable('user_meta')) {
         Schema::rename('user_meta', 'users_meta');
     }
 }
Example #25
Show file File: 2015_08_10_194221_modify_images_table.php Project: HOFB/HOFB
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::rename('uploads', 'images');
     Schema::table('images', function (Blueprint $table) {
         $table->string('href');
         $table->string('href_thumb');
         $table->integer('imageable_id');
         $table->string('imageable_type');
         $table->integer('image_type_id');
         $table->dropColumn('path');
         $table->dropColumn('upload_type');
         $table->dropColumn('user_id');
     });
 }
Example #26
Show file File: TableResolverTestClass.php Project: sebwas/laravel-migration-physical-backup
0
 public function up()
 {
     Schema::create('table_should_not_appear_create');
     Schema::table('changing_table', function ($table) {
         // Changing stuff here
     });
     Schema::rename('renaming_table', 'new_name_table');
     Schema::drop('dropping_table');
     Schema::dropIfExists('dropping_table_if_exists');
     // Schema::drop('table_should_not_appear_single_line_comment');
     /*
     				Schema::drop('table_should_not_appear_multi_line_comment');
     */
 }
Example #27
Show file File: 2015_12_01_145753_add_foreign_keys_for_all_tables.php Project: TemRhythm/priola-website
0
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::table('product_lines', function (Blueprint $table) {
         $table->foreign('product_category_id')->references('id')->on('product_categories');
         $table->integer('product_category_id')->unsigned()->change();
     });
     Schema::table('products', function (Blueprint $table) {
         $table->renameColumn('product_catalog_id', 'product_category_id');
         $table->renameColumn('master_class', 'master_class_id');
     });
     Schema::table('products', function (Blueprint $table) {
         $table->foreign('product_category_id')->references('id')->on('product_categories');
         $table->integer('product_category_id')->unsigned()->change();
         $table->foreign('product_line_id')->references('id')->on('product_lines');
         $table->integer('product_line_id')->unsigned()->change();
         $table->foreign('master_class_id')->references('id')->on('master_classes');
         $table->integer('master_class_id')->unsigned()->change();
     });
     Schema::table('master_class_steps', function (Blueprint $table) {
         $table->foreign('master_class_id')->references('id')->on('master_classes');
         $table->integer('master_class_id')->unsigned()->change();
     });
     Schema::table('product_colors', function (Blueprint $table) {
         $table->foreign('product_id')->references('id')->on('products');
         $table->integer('product_id')->unsigned()->change();
     });
     Schema::table('product_reviews', function (Blueprint $table) {
         $table->foreign('product_id')->references('id')->on('products');
         $table->integer('product_id')->unsigned()->change();
     });
     Schema::table('course_program_items', function (Blueprint $table) {
         $table->foreign('course_id')->references('id')->on('courses');
         $table->integer('course_id')->unsigned()->change();
     });
     Schema::table('course_gallery_items', function (Blueprint $table) {
         $table->foreign('course_id')->references('id')->on('courses');
         $table->integer('course_id')->unsigned()->change();
     });
     Schema::rename('feedback_feedback_tag', 'review_review_tag');
     Schema::table('review_review_tag', function (Blueprint $table) {
         $table->renameColumn('feedback_id', 'review_id');
         $table->renameColumn('feedback_tag_id', 'review_tag_id');
     });
     Schema::table('review_review_tag', function (Blueprint $table) {
         $table->foreign('review_id')->references('id')->on('reviews');
         $table->integer('review_id')->unsigned()->change();
         $table->foreign('review_tag_id')->references('id')->on('review_tags');
         $table->integer('review_tag_id')->unsigned()->change();
     });
 }
Example #28
Show file File: 2015_08_05_132158_RenameColumns.php Project: reiniersb87/website
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::rename('projects_taggables', 'taggables');
     Schema::rename('projects_categoryables', 'categorables');
     Schema::table('categorables', function ($table) {
         $table->renameColumn('project_category_id', 'category_id');
         $table->renameColumn('projects_categoryables_id', 'categorable_id');
         $table->renameColumn('projects_categoryables_type', 'categorable_type');
     });
     Schema::table('taggables', function ($table) {
         $table->renameColumn('project_tag_id', 'tag_id');
         $table->renameColumn('projects_taggable_id', 'taggable_id');
         $table->renameColumn('projects_taggable_type', 'taggable_type');
     });
 }
Example #29
Show file File: 2015_08_24_141645_alter_investigacao_campos.php Project: kuell/buriti
0
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::rename('farmacia_natureza_lesao', 'natureza_lesao');
     Schema::rename('farmacia_parte_corpo', 'parte_corpo');
     DB::statement('alter table natureza_lesao set schema farmacia');
     DB::statement('alter table parte_corpo set schema farmacia');
     Schema::table('sesmt.investigacaos', function (Blueprint $table) {
         $table->string('tipo_ocorrencia')->nullable();
         $table->string('classificacao')->nullable();
         $table->string('potencial_risco')->nullable();
         $table->string('probabilidade')->nullable();
         $table->date('data_acidente')->nullable();
         $table->time('horas_trabalhadas')->nullable();
         $table->string('local_acidente')->nullable();
         $table->string('tipo_lesao')->nullable();
         $table->boolean('houve_afastamento')->nullable();
         $table->integer('dias_afastamento')->nullable();
         $table->boolean('houve_instrucao_tarefa')->nullable();
         $table->boolean('ferramenta_boa_condicao')->nullable();
         $table->boolean('colaborador_reincidente')->nullable();
         $table->boolean('fez_treinamento_prevencionista')->nullable();
         $table->boolean('colaborador_usava_epi')->nullable();
         $table->boolean('colaborador_possui_ferias')->nullable();
         $table->boolean('fez_hora_extra')->nullable();
         $table->boolean('outros_colaboradores_tarefa')->nullable();
         $table->boolean('houve_instrucao_prevencionista')->nullable();
         $table->integer('natureza_lesao_id')->nullable();
         $table->boolean('parte_corpo_id')->nullable();
         $table->string('fator_potencial')->nullable();
         $table->string('rota_acidente')->nullable();
         $table->text('descricao_acidente')->nullable();
         $table->boolean('testemunhas')->nullable();
         $table->boolean('houve_remocao_especializada')->nullable();
         $table->string('local_assistencia_medica')->nullable();
         $table->time('horario_atendimento')->nullable();
         $table->string('cid')->nullable();
         $table->boolean('devera_afastar')->nullable();
         $table->boolean('qtde_dias')->nullable();
     });
     Schema::create('sesmt.investigacao_acoes', function (Blueprint $table) {
         $table->increments('id');
         $table->integer('investigacao_id');
         $table->text('acao');
         $table->string('quem');
         $table->date('quando');
         $table->string('status');
     });
 }
Example #30
Show file File: 2014_07_03_230147_after_cartalyst_sentinel.php Project: SawMaineK/josh-admin
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::rename('users', 'users_sentry');
     Schema::create('users', function (Blueprint $table) {
         $table->increments('id');
         $table->string('email');
         $table->string('password');
         $table->text('permissions')->nullable();
         $table->timestamp('last_login')->nullable();
         $table->string('first_name')->nullable();
         $table->string('last_name')->nullable();
         $table->timestamps();
         $table->engine = 'InnoDB';
         $table->unique('email');
     });
 }