Browse Source
Merge pull request #8315 from abpframework/issue/6078
Cli: enable Oracle to database system
pull/8316/head
maliming
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
6 additions and
5 deletions
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/ConnectionStringProvider.cs
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/DatabaseManagementSystemChangeStep.cs
|
|
|
@ -419,8 +419,8 @@ namespace Volo.Abp.Cli.Commands |
|
|
|
return DatabaseManagementSystem.OracleDevart; |
|
|
|
case "sqlite": |
|
|
|
return DatabaseManagementSystem.SQLite; |
|
|
|
case "oracle": // Currently disabled. See https://github.com/abpframework/abp/issues/6513
|
|
|
|
// return DatabaseManagementSystem.Oracle;
|
|
|
|
case "oracle": |
|
|
|
return DatabaseManagementSystem.Oracle; |
|
|
|
default: |
|
|
|
return DatabaseManagementSystem.NotSpecified; |
|
|
|
} |
|
|
|
|
|
|
|
@ -17,7 +17,7 @@ namespace Volo.Abp.Cli.Commands.Services |
|
|
|
return "Server=localhost;Port=3306;Database=MyProjectName;Uid=root;Pwd=myPassword;"; |
|
|
|
case DatabaseManagementSystem.PostgreSQL: |
|
|
|
return "Host=localhost;Port=5432;Database=MyProjectName;User ID=root;Password=myPassword;Pooling=true;MinimumPoolSize=0;MaximumPoolSize=100;Connection Lifetime=0;"; |
|
|
|
//case DatabaseManagementSystem.Oracle:
|
|
|
|
case DatabaseManagementSystem.Oracle: |
|
|
|
case DatabaseManagementSystem.OracleDevart: |
|
|
|
return "Data Source=MyProjectName;Integrated Security=yes;"; |
|
|
|
case DatabaseManagementSystem.SQLite: |
|
|
|
|
|
|
|
@ -29,6 +29,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps |
|
|
|
ChangeEntityFrameworkCoreDependency(context,"Volo.Abp.EntityFrameworkCore.Oracle", |
|
|
|
"Volo.Abp.EntityFrameworkCore.Oracle", |
|
|
|
"AbpEntityFrameworkCoreOracleModule"); |
|
|
|
AdjustOracleDbContextOptionsBuilder(context); |
|
|
|
ChangeUseSqlServer(context,"UseOracle"); |
|
|
|
break; |
|
|
|
|
|
|
|
@ -55,9 +56,9 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps |
|
|
|
private void AdjustOracleDbContextOptionsBuilder(ProjectBuildContext context) |
|
|
|
{ |
|
|
|
var dbContextFactoryFile = context.Files.FirstOrDefault(f => f.Name.EndsWith("MigrationsDbContextFactoryBase.cs", StringComparison.OrdinalIgnoreCase)) |
|
|
|
?? context.Files.First(f => f.Name.EndsWith("MigrationsDbContextFactory.cs", StringComparison.OrdinalIgnoreCase)); |
|
|
|
?? context.Files.FirstOrDefault(f => f.Name.EndsWith("MigrationsDbContextFactory.cs", StringComparison.OrdinalIgnoreCase)); |
|
|
|
|
|
|
|
dbContextFactoryFile.ReplaceText("new DbContextOptionsBuilder", |
|
|
|
dbContextFactoryFile?.ReplaceText("new DbContextOptionsBuilder", |
|
|
|
$"(DbContextOptionsBuilder<{context.BuildArgs.SolutionName.ProjectName}MigrationsDbContext>) new DbContextOptionsBuilder"); |
|
|
|
} |
|
|
|
|
|
|
|
|