#Using migrations with specific schema in SQL Server

2 messages · Page 1 of 1 (latest)

pearl sonnet
#

I've been digging around the API for a bit and can't seem to find anything on this so figured I'd ask here but when trying to create migrations with my SQL Server connection I noticed I'm not able to migrate to a specified schema within the SQL Server Database.

My work uses specific schemas for specific applications to help us manage tables so everything isn't just in dbo. I'm able to access tables, views and even stored procedures in specified schemas inside of models through the protected $table = "schema.table"; just fine but just can't seem to get migrations working.

pearl sonnet
#

Messing around further I tried using the 'prefix' option in the database.php config file. I tried adding my schema name to that and noticed it was still defaulting to the dbo schema because it was now just doing 'schemanametablename' as the hasTable() method in Builder.php just smashes the two strings together.

However trying to set 'prefix' => 'schemaname.' that the '.' at the end just causes php artisan migrate to seg fault as it tries to create the migrations table