You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 4, 2024. It is now read-only.
<?php/** * Table for CompanyPaymentMethod */class m230530_130000_change_table_table_name extends \yii\db\Migration
{
publicfunctionsafeUp()
{
$this->alterColumn('{{%table_name}}', 'name', 'string(151) NOT NULL USING "name"::string');
}
publicfunctionsafeDown()
{
$this->alterColumn('{{%table_name}}', 'name', 'varchar(150) NOT NULL USING "name"::varchar');
}
}
By applying this migration, we get below error:
> alter column name in table {{%table_name}} to string(151) NOT NULL USING "name"::string ...Exception: SQLSTATE[42704]: Undefined object: 7 ERROR: type "string" does not exist at character 91
The SQL being executed was: ALTER TABLE "table_name" ALTER COLUMN "name" TYPE varchar(151) USING "name"::string, ALTER COLUMN "name" DROP DEFAULT, ALTER COLUMN "name" SET NOT NULL