C
C#12mo 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
Pobiega12mo 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
DrunkreaperOP12mo ago
I am using EF Core
Pobiega
Pobiega12mo ago
Code first, or database first? ie, did you create the database yourself or let EF make it?
Drunkreaper
DrunkreaperOP12mo ago
i made it myself and then started creating the project after it
Pobiega
Pobiega12mo 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
DrunkreaperOP12mo ago
hm ok ty guess im off to check how to make that script sql file
Pobiega
Pobiega12mo 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
DrunkreaperOP12mo ago
azure data studio
Pobiega
Pobiega12mo ago
hm, thats similar to SSMS isnt it?
Drunkreaper
DrunkreaperOP12mo ago
i think so yea
Pobiega
Pobiega12mo ago
try rightclicking the database and see if you have any "generate script" or something like that
Drunkreaper
DrunkreaperOP12mo ago
yea I found something about it needing an extension for that in stack overflow
No description
Drunkreaper
DrunkreaperOP12mo ago
ok will try this out then

Did you find this page helpful?