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

--
You received this message because you are subscribed to the Google Groups 
"migratordotnet-devel" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/migratordotnet-devel?hl=en.

Reply via email to