ef-enum-to-lookup icon indicating copy to clipboard operation
ef-enum-to-lookup copied to clipboard

exception at 'OBJECT_ID('Enum_TableName', 'U')' when using MySQL/ MariaDB

Open seevali opened this issue 10 years ago • 2 comments

I'm using MariaDB with EF6.

This is the error when running the Update-Database

"You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'IF OBJEC_TID('Enum_TableName', 'U') IS NULL CREATE TABLE [Enum_TableName' at line 1"

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

seevali avatar Jan 15 '15 13:01 seevali

Thanks, this project has been written with Sql Server specific SQL embedded in it as you gathered.

Feel free to fork the project and come up with an approach for multiple dbms support. Let me know how you get on if you do.

timabell avatar Jan 15 '15 14:01 timabell

The relevant line is https://github.com/timabell/ef-enum-to-lookup/blob/master/EfEnumToLookup/LookupGenerator/EnumToLookup.cs#L191 but you'll find more things than that in there, that just happens to be the first thing you hit.

timabell avatar Jan 15 '15 14:01 timabell