Advertisement
onzulin

Migration1 MySQL error en tamaño de campos

Mar 27th, 2019
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.82 KB | None | 0 0
  1. Error a la hora de crear las migraciones
  2.  
  3. PM> Add-Migration [M1]
  4. Microsoft.EntityFrameworkCore.Infrastructure[10403]
  5. Entity Framework Core 2.2.3-servicing-35854 initialized 'ApplicationDbContext' using provider 'MySql.Data.EntityFrameworkCore' with options: None
  6. An operation was scaffolded that may result in the loss of data. Please review the migration for accuracy.
  7. To undo this action, use Remove-Migration.
  8. PM> Update-Database
  9. Microsoft.EntityFrameworkCore.Infrastructure[10403]
  10. Entity Framework Core 2.2.3-servicing-35854 initialized 'ApplicationDbContext' using provider 'MySql.Data.EntityFrameworkCore' with options: None
  11. Microsoft.EntityFrameworkCore.Database.Command[20101]
  12. Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
  13. SELECT 1 FROM information_schema.tables
  14. WHERE table_name = '
  15. __EFMigrationsHistory' AND table_schema = DATABASE()
  16. Microsoft.EntityFrameworkCore.Database.Command[20101]
  17. Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
  18. SELECT 1 FROM information_schema.tables
  19. WHERE table_name = '
  20. __EFMigrationsHistory' AND table_schema = DATABASE()
  21. Microsoft.EntityFrameworkCore.Database.Command[20101]
  22. Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
  23. SELECT `MigrationId`, `ProductVersion`
  24. FROM `__EFMigrationsHistory`
  25. ORDER BY `MigrationId`;
  26. Microsoft.EntityFrameworkCore.Migrations[20402]
  27. Applying migration '00000000000000_CreateIdentitySchema'.
  28. Applying migration '00000000000000_CreateIdentitySchema'.
  29. Microsoft.EntityFrameworkCore.Database.Command[20101]
  30. Executed DbCommand (529ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
  31. CREATE TABLE `AspNetRoles` (
  32. `Id` varchar(767) NOT NULL,
  33. `Name` varchar(256) NULL,
  34. `NormalizedName` varchar(256) NULL,
  35. `ConcurrencyStamp` text NULL,
  36. PRIMARY KEY (`Id`)
  37. );
  38. Microsoft.EntityFrameworkCore.Database.Command[20101]
  39. Executed DbCommand (530ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
  40. CREATE TABLE `AspNetUsers` (
  41. `Id` varchar(767) NOT NULL,
  42. `UserName` varchar(256) NULL,
  43. `NormalizedUserName` varchar(256) NULL,
  44. `Email` varchar(256) NULL,
  45. `NormalizedEmail` varchar(256) NULL,
  46. `EmailConfirmed` bit NOT NULL,
  47. `PasswordHash` text NULL,
  48. `SecurityStamp` text NULL,
  49. `ConcurrencyStamp` text NULL,
  50. `PhoneNumber` text NULL,
  51. `PhoneNumberConfirmed` bit NOT NULL,
  52. `TwoFactorEnabled` bit NOT NULL,
  53. `LockoutEnd` timestamp NULL,
  54. `LockoutEnabled` bit NOT NULL,
  55. `AccessFailedCount` int NOT NULL,
  56. PRIMARY KEY (`Id`)
  57. );
  58. Microsoft.EntityFrameworkCore.Database.Command[20101]
  59. Executed DbCommand (526ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
  60. CREATE TABLE `AspNetRoleClaims` (
  61. `Id` int NOT NULL,
  62. `RoleId` varchar(767) NOT NULL,
  63. `ClaimType` text NULL,
  64. `ClaimValue` text NULL,
  65. PRIMARY KEY (`Id`),
  66. CONSTRAINT `FK_AspNetRoleClaims_AspNetRoles_RoleId` FOREIGN KEY (`RoleId`) REFERENCES `AspNetRoles` (`Id`) ON DELETE CASCADE
  67. );
  68. Microsoft.EntityFrameworkCore.Database.Command[20101]
  69. Executed DbCommand (360ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
  70. CREATE TABLE `AspNetUserClaims` (
  71. `Id` int NOT NULL,
  72. `UserId` varchar(767) NOT NULL,
  73. `ClaimType` text NULL,
  74. `ClaimValue` text NULL,
  75. PRIMARY KEY (`Id`),
  76. CONSTRAINT `FK_AspNetUserClaims_AspNetUsers_UserId` FOREIGN KEY (`UserId`) REFERENCES `AspNetUsers` (`Id`) ON DELETE CASCADE
  77. );
  78. Microsoft.EntityFrameworkCore.Database.Command[20101]
  79. Executed DbCommand (717ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
  80. CREATE TABLE `AspNetUserLogins` (
  81. `LoginProvider` varchar(128) NOT NULL,
  82. `ProviderKey` varchar(128) NOT NULL,
  83. `ProviderDisplayName` text NULL,
  84. `UserId` varchar(767) NOT NULL,
  85. PRIMARY KEY (`LoginProvider`, `ProviderKey`),
  86. CONSTRAINT `FK_AspNetUserLogins_AspNetUsers_UserId` FOREIGN KEY (`UserId`) REFERENCES `AspNetUsers` (`Id`) ON DELETE CASCADE
  87. );
  88. fail: Microsoft.EntityFrameworkCore.Database.Command[20102]
  89. Failed executing DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
  90. CREATE TABLE `AspNetUserRoles` (
  91. `UserId` varchar(767) NOT NULL,
  92. `RoleId` varchar(767) NOT NULL,
  93. PRIMARY KEY (`UserId`, `RoleId`),
  94. CONSTRAINT `FK_AspNetUserRoles_AspNetRoles_RoleId` FOREIGN KEY (`RoleId`) REFERENCES `AspNetRoles` (`Id`) ON DELETE CASCADE,
  95. CONSTRAINT `FK_AspNetUserRoles_AspNetUsers_UserId` FOREIGN KEY (`UserId`) REFERENCES `AspNetUsers` (`Id`) ON DELETE CASCADE
  96. );
  97. MySql.Data.MySqlClient.MySqlException (0x80004005): Specified key was too long; max key length is 3072 bytes
  98. at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
  99. at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
  100. at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
  101. at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
  102. at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
  103. at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
  104. at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
  105. Failed executing DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
  106. CREATE TABLE `AspNetUserRoles` (
  107. `UserId` varchar(767) NOT NULL,
  108. `RoleId` varchar(767) NOT NULL,
  109. PRIMARY KEY (`UserId`, `RoleId`),
  110. CONSTRAINT `FK_AspNetUserRoles_AspNetRoles_RoleId` FOREIGN KEY (`RoleId`) REFERENCES `AspNetRoles` (`Id`) ON DELETE CASCADE,
  111. CONSTRAINT `FK_AspNetUserRoles_AspNetUsers_UserId` FOREIGN KEY (`UserId`) REFERENCES `AspNetUsers` (`Id`) ON DELETE CASCADE
  112. );
  113. MySql.Data.MySqlClient.MySqlException (0x80004005): Specified key was too long; max key length is 3072 bytes
  114. at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
  115. at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
  116. at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
  117. at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
  118. at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
  119. at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
  120. at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
  121. at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
  122. at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
  123. at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable`1 migrationCommands, IRelationalConnection connection)
  124. at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
  125. at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
  126. at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_1.<.ctor>b__0()
  127. at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
  128. Specified key was too long; max key length is 3072 bytes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement