Skip to content

Commit

Permalink
default database port
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Nov 19, 2024
1 parent 430b1af commit 570218b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions backend/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
string connectionString;
if (builder.Environment.IsDevelopment())
{
connectionString = builder.Configuration.GetConnectionString("HostConnection");
connectionString = builder.Configuration.GetConnectionString("HostConnection") ?? throw new InvalidOperationException("HostConnection string is missing.");
}
else
{
connectionString = builder.Configuration.GetConnectionString("ProductionConnection");
connectionString = builder.Configuration.GetConnectionString("ProductionConnection") ?? throw new InvalidOperationException("ProductionConnection string is missing.");
}

builder.Services.AddMySqlDataSource(connectionString);
Expand Down
2 changes: 1 addition & 1 deletion backend/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"ConnectionStrings": {
"DefaultConnection": "Server=mysql;Port=3306;Database=chemistry_db;User=chemistrycafedev;Password=chemistrycafe",
"HostConnection": "Server=localhost;Port=3307;Database=chemistry_db;User=chemistrycafedev;Password=chemistrycafe",
"ProductionConnection": "Server=localhost;Port=3307;Database=chemistry_db;User=chemistrycafedev;Password=chemistrycafe"
"ProductionConnection": "Server=localhost;Port=3306;Database=chemistry_db;User=chemistrycafedev;Password=chemistrycafe"
}
}
1 change: 1 addition & 0 deletions init.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- init.sql
USE chemistry_db;

-- 1. Create Tables

Expand Down

0 comments on commit 570218b

Please sign in to comment.