FirebirdSQL / NETProvider

Firebird ADO.NET Data Provider
https://www.firebirdsql.org/en/net-provider/
Other
152 stars 62 forks source link

EntityFrameworkCore Scaffolding: FbDatabaseModelFactory does not reflect NULL_FLAG from Domains #1131

Closed bgrauer-atacom closed 10 months ago

bgrauer-atacom commented 10 months ago

When using EfCore Scaffolding (Reverse Engineering) not null is interpreted not correct when using Firebird Domains.


I suppose the query in FbDatabaseModelFactory

https://github.com/FirebirdSQL/NETProvider/blob/f169563ec05067c55974d2dfe09ff4f64cfd05d9/src/FirebirdSql.EntityFrameworkCore.Firebird/Scaffolding/Internal/FbDatabaseModelFactory.cs#L149

should be

COALESCE(COALESCE(RF.RDB$NULL_FLAG, F.RDB$NULL_FLAG), 0) as NOT_NULL,

but i donw know if this has any inpacts regarding bckwards comaptibility.

cincuranet commented 10 months ago

Probably minimal impact on backwards compat. It's a bug fix. Do you care to create PR?

bgrauer-atacom commented 10 months ago

Shure. Want me to write a test?

cincuranet commented 10 months ago

Test would be lovely.