Skip to content

Table creation issue with SQL reserved word property names #107

@jjbutera

Description

@jjbutera

I'm sure it's just a bracketing issue on the SQL create statements. My entity has a property named Order which fails to generated the database file (syntax error). When renamed to Orderx, it works fine.

After some trial and error, I've determined the issue occurs when a reserved word property is part of an index. The DB creation works fine if I comment out the index annotation above Order:

`

	[Index("IX_MacroCommandDuplicate", Order = 1, IsUnique = true)]
	public int MacroStepId { get; set; }

	[Index("IX_MacroCommandDuplicate", Order = 2, IsUnique = true)]
	public int Order { get; set; }

`

Possible fix:
CreateIndexStatement.cs

IEnumerable<string> orderedColumnNames = Columns.OrderBy(c => c.Order).Select(c => $"[{c.Name}]");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions