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
I tested the connection and there are some issues with that.
The sqlsrv driver is not installed in the docker
It could be fixed like this
RUN apt-get update && apt-get install -y gnupg2
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get -y --no-install-recommends install msodbcsql17 unixodbc-dev
RUN pecl install sqlsrv
RUN pecl install pdo_sqlsrv
RUN docker-php-ext-enable sqlsrv pdo_sqlsrv
I verified it but did not optimize: maybe another version of ubuntu should be set or some packages were installed previously.
2. In some queries the collation is hardcoded collation('utf8mb4_bin')
This type of collation is not supported by MS SQL, so the easy way is to redefine it with DB_COLLATION env var or use it from the connection.
3. The SQL syntax ALTER TABLE .* MODIFY is not supported in the MS SQL. So, the migrations fail on this step. As a work-around I replaced MODIFY with env('SPECIAL_MODIFY', 'MODIFY'), but it looks hacky. Then I can pass ALTER COLUMN as SPECIAL_MODIFY.
4. The last thing, which blocked me completely, is again ALTER TABLE "ALTER TABLE lessons MODIFY raw_text MEDIUMBLOB". Unfortunately, even if the table is empty, MS SQL cannot change the column type. [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Implicit conversion from data type nvarchar(max) to varbinary(max) is not allowed. Use the CONVERT function to run this query.
I stuck here, unfortunately.
So, this is "feature request" I assume. Or, if there are any suggestions on overcoming the problem - I'm ready to test it!
The text was updated successfully, but these errors were encountered:
In database.php there is a section, describing MS SQL server connection
I tested the connection and there are some issues with that.
It could be fixed like this
I verified it but did not optimize: maybe another version of ubuntu should be set or some packages were installed previously.
2. In some queries the collation is hardcoded
collation('utf8mb4_bin')
This type of collation is not supported by MS SQL, so the easy way is to redefine it with
DB_COLLATION
env var or use it from the connection.3. The SQL syntax
ALTER TABLE .* MODIFY
is not supported in the MS SQL. So, the migrations fail on this step. As a work-around I replacedMODIFY with env('SPECIAL_MODIFY', 'MODIFY')
, but it looks hacky. Then I can pass ALTER COLUMN as SPECIAL_MODIFY.4. The last thing, which blocked me completely, is again ALTER TABLE
"ALTER TABLE lessons MODIFY raw_text MEDIUMBLOB"
. Unfortunately, even if the table is empty, MS SQL cannot change the column type.[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Implicit conversion from data type nvarchar(max) to varbinary(max) is not allowed. Use the CONVERT function to run this query.
I stuck here, unfortunately.
So, this is "feature request" I assume. Or, if there are any suggestions on overcoming the problem - I'm ready to test it!
The text was updated successfully, but these errors were encountered: