Reputation: 2243
In Laravel 5.7 I created tiny field with rule
$table->tinyInteger('renewal_raise_invoice_before')->unsigned()->nullable()->after('renewal_raise_invoice_pre_pay');
But it appears that I need a bigger range. Which is the correct way to change its type to smallInteger?
Upvotes: 1
Views: 71
Reputation: 81
In case you ran into some mysql issues as I ran before with 5.7 & 5.8 and MySql 8 you can do RAW queries in the migration
Schema::table('table_name',function (Blueprint $table){
DB::statement('ALTER TABLE table_name MODIFY COLUMN renewal_raise_invoice_before smallint UNSIGNED NULL');
}
Upvotes: 1
Reputation: 528
Make new migration with:
Schema::table('sometable',function (Blueprint $table){
$table->smallInteger('renewal_raise_invoice_before')->unsigned()->nullable()->change();
});
Upvotes: 1