Open MrTony1987 opened 2 weeks ago
Hey @MrTony1987, thanks for the report. That's really weird 🤔 How is your "Player" class defined?
Hey @MrTony1987, thanks for the report. That's really weird 🤔 How is your "Player" class defined?
Hello, my code only contains the content in the Start method, with nothing else. You can freely create a MonoBehaviour script that includes this Start method and attach it to a GameObject. Then, print the log to the screen, and run it multiple times on an Android device to check the logs.
Well, you didn't really put the definition of Player in your code in this issue. I'm assuming you are using the same code that is present in this repository's README file.
public class Player
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
public string Name { get; set; }
}
I'll try to reproduce on an Android build here.
Also, tip for next time: use "```cs" to highlight code blocks with C# syntax =]
Ok, I've been able to reproduce this bug here. It's really weird, in my device the table is created only with the "Name" column, there's no "Id" column whatsoever 🫠
This is probably a bug in SQLite-net, as I've enabled the tracer function and the "CREATE TABLE" statement is missing the "Id" column 😔 In the subsequent sessions, where the database and the table exists, I get a "duplicate column name" just like you, although in my case the duplicated column is "Name". I added some Debug.Log
s and found out that for whatever reason, SQLiteConnection.GetTableInfo
is returning a list with null Columns, which causes SQLite-net to attempt to re-add the column and the bug to appear.
This needs more investigation, but it seems like a bug in the ORM code from SQLite-net.
Tested in Unity 2022.3.25.
Hello, I found a problem. After building and running the above example on an Android device, starting from the second launch, an exception is thrown: “SQLiteException: duplicate column name: Id.”. Editor is OK. v1.1.0