C#
C#

help

Root Question Message

Elio
Elio8/26/2022
Mutiple Database

hi, i want to create 2 different database which one with Materials and the other one with Programs in order to easily extract the database on usb key if i want to save them separately.
is there a way to use add migration only on the directory Programs ? i know there is a way to focus ProgramsDbContext but i didnt find anything to specify the directory.
Elio
Elio8/26/2022
or should i keep only 1 database and save them separately with another solution ?
Duke
Duke8/26/2022
@173800283548286976 wdym extract the database on a USB key
Elio
Elio8/26/2022
saving the database on usb key
Elio
Elio8/26/2022
because i'm using sqlite so i use a file *.db to store my data
Duke
Duke8/26/2022
yeah
Duke
Duke8/26/2022
why do you need it on a usb tho
Elio
Elio8/26/2022
if the user need to keep a save to avoid any manipulation problem like deleting the wrong programs etc.
Elio
Elio8/26/2022
or simply to reuse the program on another machine
gerard
gerard8/26/2022
It's possible to target a DbContext with --context (docs: https://docs.microsoft.com/en-us/ef/core/cli/dotnet#common-options)
So for example: dotnet ef migrations add MyCoolMigration --context ProgramsDbContext
gerard
gerard8/26/2022
After that you can move the migration to the folder you like, if you add a new migration it'll auto detect the folder where the other migrations are and it'll put it in there.
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy