doConnect for SQLite is unable to create the unique index names

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
pankajsachdeva85
Posts: 5
Joined: Fri 17 Jan 2014 09:43

doConnect for SQLite is unable to create the unique index names

Post by pankajsachdeva85 » Fri 17 Jan 2014 09:53

Hi,

I have created a sample application in which there are two one-to-many relationships between two POCO classes and the design is as follows:

Code: Select all

public class Institution
{
  [Key]
  public int RowId { get; set; }
}

public class School : Institution
{ 
  public string Name { get; set; }

  public List <Student> Students { get; private set; }
  public List <Student> Alumni { get; private set; }
}

public class Student
{
  public List <Course> Courses { get; set; }

  [Key]
  public int RowId { get; set; }
}
So, here you can see that class “School” contains two navigation collection properties of type “Student”. When I created the database from code, then ideally it should create two indices “IX_FK_School_Alumini” and “IX_FK_Students” but it does create only one index “IX_FK_School_Student”. So, the next time when the provider tries to add another index for second property the provider raises an exception that index already available.

Please let me know if there is any solution for this issue or is there any workaround to this issue?

Thanks,
Pankaj Sachdeva

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: doConnect for SQLite is unable to create the unique index names

Post by Shalex » Fri 17 Jan 2014 13:42

We have reproduced the issue and are investigating it. We will notify you about the result as soon as possible.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: doConnect for SQLite is unable to create the unique index names

Post by Shalex » Mon 27 Jan 2014 10:13

The bug with creating indices for foreign key columns, when two tables are referenced by two or more FKs, in Code-First functionality is fixed. We will notify you when the corresponding build of dotConnect for SQLite is available for download.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: doConnect for SQLite is unable to create the unique index names

Post by Shalex » Thu 30 Jan 2014 15:56

New build of dotConnect for SQLite 5.1.90 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/sqlite/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=29&t=28827.

pankajsachdeva85
Posts: 5
Joined: Fri 17 Jan 2014 09:43

Re: doConnect for SQLite is unable to create the unique index names

Post by pankajsachdeva85 » Fri 31 Jan 2014 10:09

Thanks Shalex for the update, I have tried the latest provider and the issue is fixed.

Post Reply