Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • Fix/xxxx-updateDependencies
  • Hotfix/0071-fixResourceCreate
  • Hotfix/1035-fixResourceApi
  • Hotfix/1360-databaseScaffolding
  • Hotfix/1383-topLevel
  • Hotfix/1383-topLevelAlternative
  • Hotfix/1433-defaultQuota
  • Hotfix/1796-projectDdos
  • Hotfix/2087-efNet6
  • Hotfix/64-releaseUDE
  • Hotfix/73-fixResourceCreateRDS
  • Issue/1321-pidEnquiryOverhaul
  • Issue/1788-extractionCronjob
  • Issue/1866-ExtendResourceTypeConfigurationTUDo
  • Issue/1867-addNewResourceTypes
  • Issue/1877-ExtendResourceTypeConfigurationNRWFHs
  • Issue/1878-addNewResourceTypes
  • Issue/1910-MigrationtoNET6.0
  • Issue/1913-ModificationsResourceMetadata
  • Issue/1951-quotaImplementation
  • Issue/1999-gitlabResourcesLib
  • Issue/2072-wormResourceType
  • Issue/2101-gitLabResTypeUi
  • Issue/2102-gitLabResTypeRCV
  • Issue/2183-kpiGeneratorResource
  • Issue/2221-projectDateCreated
  • Issue/2222-resourceDateCreated
  • Issue/2278-gitlabToS
  • Issue/2287-guestRole
  • Issue/2309-docs
  • Issue/2364-testingKpiParser
  • Issue/2449-GuidPidSlugToProjectSettings
  • Issue/3003-stsInstitute
  • Issues/0028-maxQuotaFix
  • Product/1100-fdsS3
  • Product/1149-dfnaai
  • Product/1154-resourceTypeDefinition
  • Product/1188-LoggingExtended
  • Product/1287-dotnet5Sharepoint
  • Product/1414-fhPrivileges
  • Product/1470-migrationForArchiving
  • Product/1573-ReadOnlyResources
  • Product/1629-onboardingOtherUniversities
  • Product/202-userInvitation
  • Product/407-net5migration
  • Product/704-basicReporting
  • Product/789-userContactEmail
  • Product/903-ApiTokens
  • Sprint/2020-20
  • Sprint/2020-22
  • Sprint/2021-01
  • Sprint/2021-03
  • Sprint/2021-04
  • Sprint/2021-05
  • Sprint/2021-08
  • Sprint/2021-10
  • Sprint/2021-11
  • Sprint/2021-15
  • Sprint/2021-19
  • Sprint/2022-01
  • Test/xxxx-pipelineTriggers
  • Topic/1051-basicReporting
  • Topic/1125-apiTokens
  • Topic/1159-rtdApi
  • Topic/1221-LogginExtendedNew
  • Topic/1221-LoggingExtended
  • Topic/1226-databaseLibraryMigration
  • Topic/1278-dfnAAI
  • Topic/1286-dotnet5Database
  • Topic/1292-FdsS3
  • Topic/1294-contactChangeFunctionality
  • Topic/1425-fhPrivileges
  • Topic/1453-userInvitation
  • Topic/1556-migrationForArchiving
  • Topic/1597-AddArchiveFlagInResourceObject
  • Topic/1711-extendResourceTypeConfiguration
  • Topic/1714-newResourceTypesUDE
  • dev
  • gitkeep
  • master
  • v1.0.0
  • v1.1.0
  • v1.10.0
  • v1.11.0
  • v1.12.0
  • v1.12.1
  • v1.13.0
  • v1.14.0
  • v1.15.0
  • v1.15.1
  • v1.16.0
  • v1.17.0
  • v1.18.0
  • v1.19.0
  • v1.2.0
  • v1.2.1
  • v1.2.2
  • v1.20.0
  • v1.21.0
  • v1.22.0
  • v1.22.1
  • v1.22.2
  • v1.23.0
  • v1.24.0
  • v1.25.0
  • v1.25.1
  • v1.26.0
  • v1.27.0
  • v1.27.1
  • v1.28.0
  • v1.3.0
  • v1.4.0
  • v1.5.0
  • v1.5.1
  • v1.6.0
  • v1.7.0
  • v1.8.0
  • v1.9.0
  • v2.0.0
  • v2.0.1
  • v2.1.0
  • v2.1.1
  • v2.10.0
  • v2.10.1
  • v2.11.0
  • v2.11.1
  • v2.12.0
  • v2.12.1
  • v2.13.0
  • v2.14.0
  • v2.15.0
  • v2.16.0
  • v2.16.1
  • v2.16.2
  • v2.17.0
  • v2.18.0
  • v2.19.0
  • v2.19.1
  • v2.2.0
  • v2.2.1
  • v2.20.0
  • v2.22.0
  • v2.3.0
  • v2.4.0
  • v2.4.1
  • v2.5.0
  • v2.6.0
  • v2.7.0
  • v2.7.1
  • v2.7.2
  • v2.7.3
  • v2.8.0
  • v2.9.0
  • v2.9.1
154 results

Target

Select target project
  • coscine/backend/libraries/database
1 result
Select Git revision
  • Fix/xxxx-updateDependencies
  • Hotfix/0071-fixResourceCreate
  • Hotfix/1035-fixResourceApi
  • Hotfix/1360-databaseScaffolding
  • Hotfix/1383-topLevel
  • Hotfix/1383-topLevelAlternative
  • Hotfix/1433-defaultQuota
  • Hotfix/1796-projectDdos
  • Hotfix/2087-efNet6
  • Hotfix/64-releaseUDE
  • Hotfix/73-fixResourceCreateRDS
  • Issue/1321-pidEnquiryOverhaul
  • Issue/1788-extractionCronjob
  • Issue/1866-ExtendResourceTypeConfigurationTUDo
  • Issue/1867-addNewResourceTypes
  • Issue/1877-ExtendResourceTypeConfigurationNRWFHs
  • Issue/1878-addNewResourceTypes
  • Issue/1910-MigrationtoNET6.0
  • Issue/1913-ModificationsResourceMetadata
  • Issue/1951-quotaImplementation
  • Issue/1999-gitlabResourcesLib
  • Issue/2072-wormResourceType
  • Issue/2101-gitLabResTypeUi
  • Issue/2102-gitLabResTypeRCV
  • Issue/2183-kpiGeneratorResource
  • Issue/2221-projectDateCreated
  • Issue/2222-resourceDateCreated
  • Issue/2278-gitlabToS
  • Issue/2287-guestRole
  • Issue/2309-docs
  • Issue/2364-testingKpiParser
  • Issue/2449-GuidPidSlugToProjectSettings
  • Issue/3003-stsInstitute
  • Issues/0028-maxQuotaFix
  • Product/1100-fdsS3
  • Product/1149-dfnaai
  • Product/1154-resourceTypeDefinition
  • Product/1188-LoggingExtended
  • Product/1287-dotnet5Sharepoint
  • Product/1414-fhPrivileges
  • Product/1470-migrationForArchiving
  • Product/1573-ReadOnlyResources
  • Product/1629-onboardingOtherUniversities
  • Product/202-userInvitation
  • Product/407-net5migration
  • Product/704-basicReporting
  • Product/789-userContactEmail
  • Product/903-ApiTokens
  • Sprint/2020-20
  • Sprint/2020-22
  • Sprint/2021-01
  • Sprint/2021-03
  • Sprint/2021-04
  • Sprint/2021-05
  • Sprint/2021-08
  • Sprint/2021-10
  • Sprint/2021-11
  • Sprint/2021-15
  • Sprint/2021-19
  • Sprint/2022-01
  • Test/xxxx-pipelineTriggers
  • Topic/1051-basicReporting
  • Topic/1125-apiTokens
  • Topic/1159-rtdApi
  • Topic/1221-LogginExtendedNew
  • Topic/1221-LoggingExtended
  • Topic/1226-databaseLibraryMigration
  • Topic/1278-dfnAAI
  • Topic/1286-dotnet5Database
  • Topic/1292-FdsS3
  • Topic/1294-contactChangeFunctionality
  • Topic/1425-fhPrivileges
  • Topic/1453-userInvitation
  • Topic/1556-migrationForArchiving
  • Topic/1597-AddArchiveFlagInResourceObject
  • Topic/1711-extendResourceTypeConfiguration
  • Topic/1714-newResourceTypesUDE
  • dev
  • gitkeep
  • master
  • v1.0.0
  • v1.1.0
  • v1.10.0
  • v1.11.0
  • v1.12.0
  • v1.12.1
  • v1.13.0
  • v1.14.0
  • v1.15.0
  • v1.15.1
  • v1.16.0
  • v1.17.0
  • v1.18.0
  • v1.19.0
  • v1.2.0
  • v1.2.1
  • v1.2.2
  • v1.20.0
  • v1.21.0
  • v1.22.0
  • v1.22.1
  • v1.22.2
  • v1.23.0
  • v1.24.0
  • v1.25.0
  • v1.25.1
  • v1.26.0
  • v1.27.0
  • v1.27.1
  • v1.28.0
  • v1.3.0
  • v1.4.0
  • v1.5.0
  • v1.5.1
  • v1.6.0
  • v1.7.0
  • v1.8.0
  • v1.9.0
  • v2.0.0
  • v2.0.1
  • v2.1.0
  • v2.1.1
  • v2.10.0
  • v2.10.1
  • v2.11.0
  • v2.11.1
  • v2.12.0
  • v2.12.1
  • v2.13.0
  • v2.14.0
  • v2.15.0
  • v2.16.0
  • v2.16.1
  • v2.16.2
  • v2.17.0
  • v2.18.0
  • v2.19.0
  • v2.19.1
  • v2.2.0
  • v2.2.1
  • v2.20.0
  • v2.22.0
  • v2.3.0
  • v2.4.0
  • v2.4.1
  • v2.5.0
  • v2.6.0
  • v2.7.0
  • v2.7.1
  • v2.7.2
  • v2.7.3
  • v2.8.0
  • v2.9.0
  • v2.9.1
154 results
Show changes
Commits on Source (3)
Showing
with 51 additions and 10 deletions
......@@ -22,21 +22,25 @@ migrate:
- dotnet tool install dotnet-ef; echo "1"
- dotnet tool update dotnet-ef
# Create new database and migrate to latest state
- dotnet build src\Database.Actions
- .\src\Database.Actions\bin\Debug\net5.0\Coscine.Database.Actions.exe --action-create --name $DB_NAME --source $DB_DATA_SOURCE --user $DB_USER_ID --pw $DB_PASSWORD
- dotnet run -p .\src\Database.Actions -- --action-create --name $DB_NAME --source $DB_DATA_SOURCE --user $DB_USER_ID --pw $DB_PASSWORD
# Scaffold created database
- dotnet ef dbcontext scaffold "Data Source=$DB_DATA_SOURCE;Integrated Security=False;User ID=$DB_USER_ID;Password=$DB_PASSWORD;Database=$DB_NAME" Microsoft.EntityFrameworkCore.SqlServer -o DataModel -c "Model" -f --no-onconfiguring --project "src\Database"
- dotnet ef dbcontext scaffold "Data Source=$DB_DATA_SOURCE;Integrated Security=False;User ID=$DB_USER_ID;Password=$DB_PASSWORD;Database=$DB_NAME" Microsoft.EntityFrameworkCore.SqlServer -o DataModel -c "Model" -f --no-onconfiguring --project "src\Scaffolding"
# Remove the hardcoded Connection String inside \DataModel\Model.cs
- Set-Content -Path ".\src\Database\DataModel\Model.txt" -Value (Get-Content -Path ".\src\Database\DataModel\Model.cs" | where { $_ | Select-String -Pattern '#warning' -NotMatch } | where { $_ | Select-String -Pattern 'Data Source=' -NotMatch } ) -Force
- Set-Content -Path ".\src\Database\DataModel\Model.cs" -Value (Get-Content -Path ".\src\Database\DataModel\Model.txt") -Force
- Remove-Item ".\src\Database\DataModel\Model.txt"
- Set-Content -Path ".\src\Scaffolding\DataModel\Model.txt" -Value (Get-Content -Path ".\src\Scaffolding\DataModel\Model.cs" | where { $_ | Select-String -Pattern '#warning' -NotMatch } | where { $_ | Select-String -Pattern 'Data Source=' -NotMatch } ) -Force
- Set-Content -Path ".\src\Scaffolding\DataModel\Model.cs" -Value (Get-Content -Path ".\src\Scaffolding\DataModel\Model.txt") -Force
- Remove-Item ".\src\Scaffolding\DataModel\Model.txt"
artifacts:
paths:
- src\Scaffolding\DataModel
expire_in: 1 week
cleanup:
stage: cleanup
extends: .dotnet-windows-base
script:
# Drop created database
- .\dist\Database.Actions\Coscine.Database.Actions.exe --action-drop --name $DB_NAME --source $DB_DATA_SOURCE --user $DB_USER_ID --pw $DB_PASSWORD
- dotnet run -p .\src\Database.Actions -- --action-drop --name $DB_NAME --source $DB_DATA_SOURCE --user $DB_USER_ID --pw $DB_PASSWORD
when: always
build-branch:
......
......@@ -14,7 +14,7 @@
<PackageReference Include="Coscine.Database.Helpers" Version="2.*-*" />
<PackageReference Include="Coscine.Migrations" Version="2.*-*" />
<PackageReference Include="linq2db" Version="3.2.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" />
<PackageReference Include="NUnit" Version="3.13.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
</ItemGroup>
......
......@@ -7,7 +7,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Database", "Database\Databa
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Database.Tests", "Database.Tests\Database.Tests.csproj", "{2A5D0EC8-E487-4B43-A311-05852464ED01}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Database.Actions", "Database.Actions\Database.Actions.csproj", "{CEFF114C-1102-43F5-9CD3-3352F18D67A4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Database.Actions", "Database.Actions\Database.Actions.csproj", "{CEFF114C-1102-43F5-9CD3-3352F18D67A4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Scaffolding", "Scaffolding\Scaffolding.csproj", "{A2A4CB04-C609-49EB-9795-829A6210711D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -27,6 +29,10 @@ Global
{CEFF114C-1102-43F5-9CD3-3352F18D67A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CEFF114C-1102-43F5-9CD3-3352F18D67A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CEFF114C-1102-43F5-9CD3-3352F18D67A4}.Release|Any CPU.Build.0 = Release|Any CPU
{A2A4CB04-C609-49EB-9795-829A6210711D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A2A4CB04-C609-49EB-9795-829A6210711D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A2A4CB04-C609-49EB-9795-829A6210711D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A2A4CB04-C609-49EB-9795-829A6210711D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -4,7 +4,7 @@
<RootNamespace>Coscine.Database</RootNamespace>
<AssemblyName>Coscine.Database</AssemblyName>
<TargetFrameworks>net5.0;net461</TargetFrameworks>
<Version>2.0.0</Version>
<Version>2.0.1</Version>
</PropertyGroup>
<PropertyGroup>
<Authors>RWTH Aachen University</Authors>
......@@ -23,6 +23,11 @@
<None Include="Coscine.Database.Key.snk" />
<Reference Include="System.Web" Condition="'$(TargetFramework)' == 'net461'" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Scaffolding\DataModel\*.*">
<Link>DataModel\%(Filename)%(Extension)</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Coscine.Configuration" Version="2.*-*" />
<PackageReference Include="LinqKit" Version="1.1.23" />
......
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.DependencyInjection;
namespace Coscine.Database
{
public class CustomDesignTimeService : IDesignTimeServices
{
public void ConfigureDesignTimeServices(IServiceCollection serviceCollection)
=> serviceCollection.AddSingleton<IPluralizer, CustomPluralizer>();
}
public class CustomPluralizer : IPluralizer
{
Inflector.Inflector _inflector = new Inflector.Inflector(System.Globalization.CultureInfo.GetCultureInfo("en-us"));
public string Pluralize(string identifier)
{
return _inflector.Pluralize(identifier) ?? identifier;
}
public string Singularize(string identifier)
{
return _inflector.Singularize(identifier) ?? identifier;
}
}
}