Latest

Tuesday, July 11, 2017

Laravel, SQL varchar

Asked by: Asim Naseer


Using laravel with MS SQL when string datatype is defined in the migration. When the migration is run it create a nvarchar datatype in the Database instead of varchar. How to restrict laravel to create varchar datatype on MS SQL server when a datatype of string is defined in migration.


Answers

Answered by: BENY at 2017-07-11 04:18PM



You should use string , there it is :

$table->string('name');

It`s will work for you .



Answered by: Ahsan at 2017-07-11 04:24PM



Check your database type in config/database.php file.

The default is MySQL, but if you are using MS SQL, it should be 'default' => 'sqlsrv', in database.php




Source

No comments:

Post a Comment

Adbox