Issue 143 in migratordotnet: SQLite.NET parse problems

2 views
Skip to first unread message

codesite...@google.com

unread,
Mar 11, 2010, 11:51:58 PM3/11/10
to migratordo...@googlegroups.com
Status: New
Owner: ----

New issue 143 by it.adviser.ua: SQLite.NET parse problems
http://code.google.com/p/migratordotnet/issues/detail?id=143

--- What steps will reproduce the problem?
1. Create DB. Create table with primary key
2. Create migration (rename table).

--- What is the expected output? What do you see instead?
Migrator not correct parse sql. Last ")" in "primary key (Id)" lost.

--- Please use labels and text to provide additional information.
Change SQLiteTransformationProvider.cs as described below:

public string[] ParseSqlColumnDefs(string sqldef)
{
if (String.IsNullOrEmpty(sqldef))
{
return null;
}

sqldef = sqldef.Replace(Environment.NewLine, " ");
int start = sqldef.IndexOf("(");
//begin primary key (column) patch
int end = sqldef.IndexOf("))");
if (end == -1)
end = sqldef.IndexOf(")");
else
{
end++;
}
//end primary key (column) patch

sqldef = sqldef.Substring(0, end);
sqldef = sqldef.Substring(start + 1);

string[] cols = sqldef.Split(new char[]{','});
for (int i = 0; i < cols.Length; i ++)
{
cols[i] = cols[i].Trim();
}
return cols;
}


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

Reply all
Reply to author
Forward
0 new messages