« first day (2279 days earlier)      last day (1870 days later) » 

11:54 AM
Hi all
 
 
1 hour later…
1:05 PM
Hey!
 
Hi Maverik
 
1:43 PM
Anybody has done a data migration in EFCore ?
so your column data needs to change applying a function on every row thats there and then having future data come in that new format
 
Hi Maverik, I've done schema migrations, but not data migrations
 
2:07 PM
MigrationBuilder.UpdateData() looked promising at first, but it doesn't quite give you what you want since it appears to take a defined value, not a value coercing a specific column.
Perhaps the Sql() method in the Up() method: stackoverflow.com/a/28640377/1617161
 
2:19 PM
strongly doubt that'd work on EFCore
Sql is no longer used in migrations directly but rather providers generate it internally while you configure provider in Up / Down via c# but thanks for looking up
 
No worries. I tested Sql("Update [SomeTable] set SomeNumber = SomeNumber + 1"); and it worked in a EF6 project. As you said, probably different in EFCore
 
yea EF6 had SQL built-in to EF itself.. EFCore has no such concept because it also deals with NoSQL Dbs
I'm sure i can pull off sql in migration myself but been wondering if anybody knows of proper way of doing it. i've never had to do data migration and fortunately the time we did need to do it, we did in EF6 so just wrote SQL to get it done and it got me to think how would I do it if this was EFCore
 
That makes sense. That was very easy in EF6, but I'm now curious as to the proper way to accomplish this in EFCore
 
3:07 PM
and, good morning!
@Maverik Yes, we are doing it
It is a hack
Custom Migration... manually being called ...
 
3:23 PM
yea thats what i was thinking
i'd have to learn provider model and forge a migration myself
not the most documented place of EFCore
 
3:34 PM
I'd love to know if there's a better way...
 
Is it that EFCore is relatively new that there's not great docs on it?
 
I suppose partially.
TIL: what ThenInclude() does
s-l-o-w-l-y learning the EFCore+MVC stack
 
3:57 PM
Feel like I'm living in the dark ages here: still doing Framework
 
sounds awful
I would think there's got to be a method in Up to help, but I haven't delved very far into that
 
Heh. Yeah. I'm tied to framework here.
 

« first day (2279 days earlier)      last day (1870 days later) »