for the applications table set the defaults for app_instance and app_instance to '' (#15278)

* add migration file for new defaults for applications table

* update the db_schema yaml and tweak the migration so it does not change the varchar size for app_status
This commit is contained in:
Zane C. Bowers-Hadley
2023-09-01 15:01:12 -05:00
committed by GitHub
parent 8eeb83928f
commit 6dbfbe99bc
2 changed files with 36 additions and 2 deletions

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ApplicationNewDefaults extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('applications', function (Blueprint $table) {
$table->string('app_instance')->default('')->change();
$table->string('app_status', 1024)->default('')->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('applications', function (Blueprint $table) {
$table->string('app_instance')->default(null)->change();
$table->string('app_status', 1024)->default(null)->change();
});
}
}

View File

@@ -183,9 +183,9 @@ applications:
- { Field: app_state, Type: varchar(32), 'Null': false, Extra: '', Default: UNKNOWN }
- { Field: discovered, Type: tinyint, 'Null': false, Extra: '', Default: '0' }
- { Field: app_state_prev, Type: varchar(32), 'Null': true, Extra: '' }
- { Field: app_status, Type: varchar(1024), 'Null': false, Extra: '' }
- { Field: app_status, Type: varchar(1024), 'Null': false, Extra: '', Default: '' }
- { Field: timestamp, Type: timestamp, 'Null': false, Extra: 'on update CURRENT_TIMESTAMP', Default: CURRENT_TIMESTAMP }
- { Field: app_instance, Type: varchar(255), 'Null': false, Extra: '' }
- { Field: app_instance, Type: varchar(255), 'Null': false, Extra: '', Default: '' }
- { Field: data, Type: longtext, 'Null': true, Extra: '' }
Indexes:
PRIMARY: { Name: PRIMARY, Columns: [app_id], Unique: true, Type: BTREE }