Skip to content

Commit

Permalink
Merge branch 'feat/8533-dotnet-auth-plugin' of https://github.com/amp…
Browse files Browse the repository at this point in the history
…lication/plugins into feat/8533-dotnet-auth-plugin
  • Loading branch information
morhag90 committed Jun 3, 2024
2 parents 9df4178 + 49a07fc commit d1f6fef
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/dotnet-db-sqlserver/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amplication/plugin-dotnet-db-sqlserver",
"version": "0.0.1",
"version": "0.0.3",
"description": "Use an MS SQL Server database in a service generated by Amplication",
"main": "dist/index.js",
"nx": {},
Expand Down
4 changes: 2 additions & 2 deletions plugins/dotnet-db-sqlserver/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const updateDockerComposeProperties = (
services: {
server: {
environment: {
ConnectionStrings__DbContext: `sqlserver://db:1433;database=${dbName};user=${user};password=${password};TrustServerCertificate=true`,
ConnectionStrings__DbContext: `Data Source=db,1433;Initial Catalog=${dbName};User Id=${user};Password=${password};TrustServerCertificate=true;`,
},
depends_on: {
migrate: {
Expand All @@ -21,7 +21,7 @@ export const updateDockerComposeProperties = (
},
migrate: {
environment: {
MIGRATION_CONNECTION: `sqlserver://db:1433;database=${dbName};user=${user};password=${password};TrustServerCertificate=true`,
MIGRATION_CONNECTION: `Data Source=db,1433;Initial Catalog=${dbName};User Id=${user};Password=${password};TrustServerCertificate=true;`,
},
},
db: {
Expand Down
4 changes: 2 additions & 2 deletions plugins/dotnet-db-sqlserver/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class MSSQLServerPlugin implements dotnetTypes.AmplicationPlugin {
eventParams.updateProperties = {
...eventParams.updateProperties,
ConnectionStrings: {
[CONNECTION_STRING]: `sqlserver://${host}:${port};database=${dbName};user=${user};password=${password};TrustServerCertificate=true`,
[CONNECTION_STRING]: `Data Source=${host},${port};Initial Catalog=${dbName};User Id=${user};Password=${password};TrustServerCertificate=true;`,
},
};
return eventParams;
Expand All @@ -78,7 +78,7 @@ class MSSQLServerPlugin implements dotnetTypes.AmplicationPlugin {

eventParams.builderServicesBlocks.push(
new CodeBlock({
code: `builder.services.AddDbContext<${serviceDbContext}>(opt => opt.UseSqlServer(builder.Configuration.GetConnectionString("${CONNECTION_STRING}")));`,
code: `builder.Services.AddDbContext<${serviceDbContext}>(opt => opt.UseSqlServer(builder.Configuration.GetConnectionString("${CONNECTION_STRING}")));`,
references: [
new ClassReference({
name: "AddDbContext",
Expand Down

0 comments on commit d1f6fef

Please sign in to comment.