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:
13 Replies
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.
I am using EF Core
Code first, or database first?
ie, did you create the database yourself or let EF make it?
i made it myself and then started creating the project after it
okay, then you can go the sql file route
its usually recommended to use code-first for the record, but its just a recommendation
hm ok ty
guess im off to check how to make that script sql file
most DB tools have a "script schema as sql file" or "script schema+data as sql file" options
what tool do you use?
azure data studio
hm, thats similar to SSMS isnt it?
i think so yea
try rightclicking the database and see if you have any "generate script" or something like that
yea I found something about it needing an extension for that in stack overflow
ok will try this out then