C
C#10mo ago
Drunkreaper

Uploading a database to a repository

So I have uploaded my API to a repository and I would presume I need to upload the database that it communicates with so it can work as intended on another person's computer. How should I upload a database to a repository? This is the connection string:
No description
13 Replies
Pobiega
Pobiega10mo ago
You wouldn't. What you normally would do is include database "migrations", which is a way to create the database on the other users computer If you are using EF Core, there is a system for this built in already You could also script your entire database a .sql file and include that in your project, if you are not using EF Core.
Drunkreaper
DrunkreaperOP10mo ago
I am using EF Core
Pobiega
Pobiega10mo ago
Code first, or database first? ie, did you create the database yourself or let EF make it?
Drunkreaper
DrunkreaperOP10mo ago
i made it myself and then started creating the project after it
Pobiega
Pobiega10mo ago
okay, then you can go the sql file route its usually recommended to use code-first for the record, but its just a recommendation
Drunkreaper
DrunkreaperOP10mo ago
hm ok ty guess im off to check how to make that script sql file
Pobiega
Pobiega10mo ago
most DB tools have a "script schema as sql file" or "script schema+data as sql file" options what tool do you use?
Drunkreaper
DrunkreaperOP10mo ago
azure data studio
Pobiega
Pobiega10mo ago
hm, thats similar to SSMS isnt it?
Drunkreaper
DrunkreaperOP10mo ago
i think so yea
Pobiega
Pobiega10mo ago
try rightclicking the database and see if you have any "generate script" or something like that
Drunkreaper
DrunkreaperOP10mo ago
yea I found something about it needing an extension for that in stack overflow
No description
Drunkreaper
DrunkreaperOP10mo ago
ok will try this out then
Want results from more Discord servers?
Add your server