-
-
Notifications
You must be signed in to change notification settings - Fork 75
Scaffolding setup now supports Firebird 2.5 #976
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |
| using System.Data.Common; | ||
| using System.Linq; | ||
| using FirebirdSql.Data.FirebirdClient; | ||
| using FirebirdSql.Data.Services; | ||
| using Microsoft.EntityFrameworkCore.Metadata; | ||
| using Microsoft.EntityFrameworkCore.Migrations; | ||
| using Microsoft.EntityFrameworkCore.Scaffolding; | ||
|
|
@@ -178,7 +179,7 @@ ELSE F.RDB$FIELD_SUB_TYPE | |
| ELSE 'RDB$FIELD_TYPE: ' || F.RDB$FIELD_TYPE || '?' | ||
| END as STORE_TYPE, | ||
| F.rdb$description as COLUMN_COMMENT, | ||
| COALESCE(RF.RDB$IDENTITY_TYPE, 0) as AUTO_GENERATED, | ||
| COALESCE({1}, 0) as AUTO_GENERATED, | ||
| ch.RDB$CHARACTER_SET_NAME as CHARACTER_SET_NAME | ||
| FROM | ||
| RDB$RELATION_FIELDS RF | ||
|
|
@@ -192,11 +193,20 @@ ORDER BY | |
|
|
||
| private void GetColumns(DbConnection connection, IReadOnlyList<DatabaseTable> tables, Func<string, string, bool> tableFilter) | ||
| { | ||
| var identity_type = "null"; | ||
|
|
||
| if (connection.State == ConnectionState.Open) | ||
| { | ||
| var serverVersion = FbServerProperties.ParseServerVersion(connection.ServerVersion); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would put this into |
||
| if (serverVersion.Major >= 3) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Store |
||
| identity_type = "rf.RDB$IDENTITY_TYPE"; | ||
| } | ||
|
|
||
| foreach (var table in tables) | ||
| { | ||
| using (var command = connection.CreateCommand()) | ||
| { | ||
| command.CommandText = string.Format(GetColumnsQuery, table.Name); | ||
| command.CommandText = string.Format(GetColumnsQuery, table.Name, identity_type); | ||
| using (var reader = command.ExecuteReader()) | ||
| { | ||
| while (reader.Read()) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point connection is known to be open.