change columns from varchar to text

This commit is contained in:
David Bomba 2022-04-26 13:39:35 +10:00
parent cb840fc06b
commit f4bfc69a49

View File

@ -0,0 +1,191 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ConvertCustomFieldsColumnFromVarcharToText extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
set_time_limit(0);
Schema::table('credits', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
Schema::table('client_contacts', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
Schema::table('clients', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
Schema::table('clients', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
Schema::table('documents', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
Schema::table('expenses', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
Schema::table('invoices', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
Schema::table('payments', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
Schema::table('products', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
Schema::table('projects', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
Schema::table('quotes', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
Schema::table('recurring_invoices', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
Schema::table('recurring_quotes', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
Schema::table('recurring_expenses', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
Schema::table('tasks', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
Schema::table('users', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
Schema::table('vendors', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
Schema::table('vendor_contacts', function (Blueprint $table) {
$table->text('custom_value1')->change();
$table->text('custom_value2')->change();
$table->text('custom_value3')->change();
$table->text('custom_value3')->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}