Issue Details (XML | Word | Printable)

Key: DNET-874
Type: Bug Bug
Status: Closed Closed
Resolution: Duplicate
Priority: Major Major
Assignee: Jiri Cincura
Reporter: Tobias Zipfel
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
.NET Data provider

Defining a sequence through the fluent API creates wrong SQL syntax

Created: 25/Mar/19 07:50 AM   Updated: 01/Apr/19 07:08 AM
Component/s: Entity Framework Core
Affects Version/s: 6.5.0.0
Fix Version/s: None

Environment: Firebird 3.0.4, embedded
Issue Links:
Duplicate
 


 Description  « Hide
When using ModelBuilder.HasSequence(string) the resulting SQL syntax executed when running context.Database.EnsureCreated() leads to a FbException:

Test:
using (var context = new TestContext(connectionString))
{
var test = context.Database.EnsureCreated();
}

In TestContext:
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasSequence("HIBERNATE_SEQUENCE");
...

Debug output:

...
dbug: Microsoft.EntityFrameworkCore.Database.Command[20100]
      Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30']
      CREATE SEQUENCE "HIBERNATE_SEQUENCE" START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE NO CYCLE;
fail: Microsoft.EntityFrameworkCore.Database.Command[20102]
      Failed executing DbCommand (26ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      CREATE SEQUENCE "HIBERNATE_SEQUENCE" START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE NO CYCLE;
FirebirdSql.Data.FirebirdClient.FbException (0x80004005): Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, column 66
NO ---> Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, column 66
NO
...



 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Tobias Zipfel added a comment - 27/Mar/19 06:41 AM
Seems like this is already fixed and will be included in the next release, or? I have seen some changes for sequences in the repo.

Jiri Cincura added a comment - 01/Apr/19 07:08 AM
Yes, this is already done as part of DNET-797.