libs/override/db/NpMigration.php
public function addCode($tableName, $columnName = 'code')
    {
        $this->addColumn('{{%' . $tableName . '}}', $columnName,
            $this->string(32)->comment('Code for this item, used identifying when needed. Another criteria to replace ID because ID is auto-increment'));
        $this->createIndex($tableName . '_' . $columnName . '_idx', '{{%' . $tableName . '}}', $columnName);
    }
public function addCode($tableName, $columnName = 'code')
    {
        $this->addColumn('{{%' . $tableName . '}}', $columnName,
            $this->string(32)->comment('Code for this item, used identifying when needed. Another criteria to replace ID because ID is auto-increment'));
        $this->createIndex($tableName . '_' . $columnName . '_idx', '{{%' . $tableName . '}}', $columnName);
    }
public function addCode ( $ tableName , $ columnName = 'code' ) { $ this -> addColumn ( '{{%' . $ tableName . '}}' , $ columnName , $ this -> string ( 32 ) -> comment ( 'Code for this item, used identifying when needed. Another criteria to replace ID because ID is auto-increment' ) ) ; $ this -> createIndex ( $ tableName . '_' . $ columnName . '_idx' , '{{%' . $ tableName . '}}' , $ columnName ) ; }
Add and put index to `code` column
Use if identity an item alternatively to ID
@param $tableName
Add and put index to code column Use if identity an item alternatively to ID