You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
789 B

  1. <?php
  2. use Movim\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. class AddBundleIdToMessagesTable extends Migration
  5. {
  6. public function up()
  7. {
  8. $this->schema->table('messages', function (Blueprint $table) {
  9. $table->integer('bundleid')->nullable();
  10. $table->index('bundleid');
  11. });
  12. $this->schema->table('bundles', function (Blueprint $table) {
  13. $table->renameColumn('bundle_id', 'bundleid');
  14. });
  15. }
  16. public function down()
  17. {
  18. $this->schema->table('messages', function (Blueprint $table) {
  19. $table->dropColumn('bundleid');
  20. });
  21. $this->schema->table('bundles', function (Blueprint $table) {
  22. $table->renameColumn('bundleid', 'bundle_id');
  23. });
  24. }
  25. }