kgrzybek / modular-monolith-with-ddd

Full Modular Monolith application with Domain-Driven Design approach.
MIT License
10.82k stars 1.7k forks source link

how to execute .\build MigrateDatabase "connection_string" #290

Open Tony20221 opened 8 months ago

Tony20221 commented 8 months ago

The readme has this: Run database migrations using MigrateDatabase NUKE target: .\build MigrateDatabase "connection_string"

How does one run this command?

vikramvee commented 7 months ago

Replace the connection_string with the connection string for your SQL server. You need to navigate to the root folder i.e. "modular-monolith-with-ddd" in the command prompt and execute the command.

For Example, for me it was like below in command prompt. The command basically execute the build.ps1 powershell script.

C:\Study\GitProjects\modular-monolith-with-ddd>.\build MigrateDatabase --DatabaseConnectionString "Server=localhost\SQLEXPRESS;Database=MyMeetings;Trusted_Connection=True;TrustServerCertificate=True"

domenperc commented 5 months ago

Hello, I suggest updating the README file. The following command worked for me: .\build MigrateDatabase -DatabaseConnectionString "connection_string"

To answer OP: Open powershell in the root folder where build.ps1 file is and run the command. Replace "connecton_string" with your actual connection string. You can copy it from SQL Server manager under database properties. I removed all the parameters except Initial Catalog to remove any conflicts for a start.