here code in migration:
public function up() { schema::table('companies', function (blueprint $table) { $table->char('default_unit_for_weight', 2)->default('kg')->after('notes')->change(); $table->char('default_currency', 3)->default('eur')->after('default_unit_for_weight')->change(); }); } when run migration, following error:
[doctrine\dbal\dbalexception] unknown column type "char" requested. doctrine type use has registered \doctrine\dbal\types\type::addtype(). can list of known types \doctrine\dbal\types\type::gettypesmap(). if error occurs during database introspection might have forgot register database types doctrine type. use abstractplatform#registerdoctrinetypemapping() or have custom types implement type#getmappeddatabasetypes(). if type name empty might have problem cache or forgot mapping information.
when checked \doctrine\dbal\types\type class, found following code:
const tarray = 'array'; const simple_array = 'simple_array'; const json_array = 'json_array'; const bigint = 'bigint'; const boolean = 'boolean'; const datetime = 'datetime'; const datetimetz = 'datetimetz'; const date = 'date'; const time = 'time'; const decimal = 'decimal'; const integer = 'integer'; const object = 'object'; const smallint = 'smallint'; const string = 'string'; const text = 'text'; const binary = 'binary'; const blob = 'blob'; const float = 'float'; const guid = 'guid'; this means doctrine not support datatype char. there way make possible change column attributes in laravel 5.1 char datatype?
you can use raw queries migrate (db::statement('query')), i'm not sure if eloquent won't panic, shouldn't though
Comments
Post a Comment