Setting up a Blog template on Piranha CMS using MySQL Db/Identity
See original GitHub issueHello @tidyui
I think that I might’ve found (and possibly resolved) a new? issue.
I have tried setting up a new project. I’ve tried following the instructions from this page: Blog Template
Changing the Startup.cs
file to be using <IdentityMySQLDb>
led to this problem (before it was run initially).
When I ran the command dotnet run
it exited with an error, trying to execute the following command:
CREATE UNIQUE INDEX
IX_Piranha_Aliases_SiteId_AliasUrl
ONPiranha_Aliases
(SiteId
,AliasUrl
);
I did some googling and found out that the error that I was getting #1071 - Specified key was too long; max key length is 767 bytes
And I thought that the solution was this: You have to change the VARCHAR to 255 (from 256) to make it work. Yeah, it worked for creating the index, but then it had more problems. So, what I found next was changing the collation.
Using the collation “latin1_bin” solves the problem.
I think it is because it uses 1 byte per character, while utf8_bin (which I tried first) uses 3 bytes per character.
I did not find where the SQL execution commands are stored, but maybe changing them globally to use VARCHAR(255) fields or just another collation will solve it for future problems.
I can still add some information if the provided is not sufficient
P.S. - Running it on localhost with:
10.1.37-MariaDB UTF-8 Unicode Apache/2.4.37 PHP: 7.2.12
on XAMPP
P.S.2 - Can you please my other issue with the posts access, please? I have reopened it.
Best Regards, Chris
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
This hasn’t been tested or released yet so let’s keep it open. We’ll try to get it done for the next release
I will make a test and see what happens if I change all of the already existing migrations and db setup to use a maximum of 255 chars instead of 256. Hopefully EF Core will not consider the migrations changed meaning that all new databases will be created with the new max length, but existing databases will be left alone.