Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining a sequence through the fluent API creates wrong SQL syntax [DNET874] #804

Closed
firebird-automations opened this issue Mar 25, 2019 · 4 comments

Comments

@firebird-automations
Copy link

Submitted by: Tobias Zipfel (tobiasz)

Duplicates DNET797

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
...

@firebird-automations
Copy link
Author

Commented by: Tobias Zipfel (tobiasz)

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.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Link: This issue duplicates DNET797 [ DNET797 ]

@firebird-automations
Copy link
Author

Commented by: @cincuranet

Yes, this is already done as part of DNET797.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => Closed [ 6 ]

resolution: Duplicate [ 3 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants