Sin entrar en detalles mayores, estoy pasándome de trabajar mi aplicación de MySql a SQLServer (por razones muy obligadas) y todo es desde ubuntu. La cuestión es que el esquema generado para sql presenta un error, y quisiera saber si alguno conoce la causa y solución.
en MySql
Código MySQL:
Ver original
CREATE TABLE User (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(255) NOT NULL, username_canonical VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, email_canonical VARCHAR(255) NOT NULL, enabled TINYINT(1) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked TINYINT(1) NOT NULL, expired TINYINT(1) NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', credentials_expired TINYINT(1) NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, nombres VARCHAR(255) DEFAULT NULL, apellidos VARCHAR(255) DEFAULT NULL, codigoUsuario VARCHAR(255) DEFAULT NULL, foto VARCHAR(255) DEFAULT NULL, iniciales VARCHAR(255) DEFAULT NULL, google_id VARCHAR(255) DEFAULT NULL, google_access_token VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_2DA1797792FC23A8 (username_canonical), UNIQUE INDEX UNIQ_2DA17977A0D96FBF (email_canonical), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB
En SQLServer se divide en varias querys
Código SQL:
Ver original
CREATE TABLE [USER] (id INT IDENTITY NOT NULL, username NVARCHAR(255) NOT NULL, username_canonical NVARCHAR(255) NOT NULL, email NVARCHAR(255) NOT NULL, email_canonical NVARCHAR(255) NOT NULL, enabled BIT NOT NULL, salt NVARCHAR(255) NOT NULL, password NVARCHAR(255) NOT NULL, last_login DATETIME2(6), locked BIT NOT NULL, expired BIT NOT NULL, expires_at DATETIME2(6), confirmation_token NVARCHAR(255), password_requested_at DATETIME2(6), roles VARCHAR(MAX) NOT NULL, credentials_expired BIT NOT NULL, credentials_expire_at DATETIME2(6), nombres NVARCHAR(255), apellidos NVARCHAR(255), codigoUsuario NVARCHAR(255), foto NVARCHAR(255), iniciales NVARCHAR(255), google_id NVARCHAR(255), google_access_token NVARCHAR(255), deleted_at DATETIME2(6), PRIMARY KEY (id)) CREATE UNIQUE INDEX UNIQ_2DA1797792FC23A8 ON [USER] (username_canonical) WHERE username_canonical IS NOT NULL CREATE UNIQUE INDEX UNIQ_2DA17977A0D96FBF ON [USER] (email_canonical) WHERE email_canonical IS NOT NULL
y estos son los errores que me salen al correrlo en SQLServer
Error An exception occurred while executing 'CREATE UNIQUE INDEX UNIQ_2DA1797792FC23A8 ON [User] (username_canonical) WHERE username_canonical IS NOT NULL':
SQLSTATE[HY000]: General error: 1935 General SQL Server error: Check messages from the SQL Server [1935] (severity 16) []
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY000]: General error: 3903 General SQL Server error: Check messages from the SQL Se
rver [3903] (severity 16) []
[PDOException]
SQLSTATE[HY000]: General error: 3903 General SQL Server error: Check messages from the SQL Se
rver [3903] (severity 16) []
Agradezco si alguien es multiDBA o sabe cómo podría solucionarlo
Gracias!