Commit 5a3afd0e authored by Marcel Nellesen's avatar Marcel Nellesen
Browse files

Update: Create Migration for DFN-AAI (coscine/issues#1277)

parent 9961b2fb
......@@ -5,58 +5,17 @@
<AssemblyName>Migrations.Tests</AssemblyName>
<TargetFrameworks>net5.0;net461</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Coscine.Configuration" Version="1.6.0" />
<PackageReference Include="Coscine.Database.Helpers" Version="1.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="NUnit" Version="3.13.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Migrations\Migrations.csproj">
<Project>{447e8ba5-30e3-4521-b6f6-51a064098026}</Project>
<Name>Migrations</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Consul" Version="1.6.1.1" />
<PackageReference Include="Coscine.Configuration" Version="*-*" />
<PackageReference Include="Coscine.Database.Helpers" Version="*-*" />
<PackageReference Include="FluentMigrator" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Abstractions" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Extensions.Oracle" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Extensions.Postgres" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Extensions.SqlAnywhere" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Extensions.SqlServer" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.Core" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.Db2" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.Firebird" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.Hana" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.Jet" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.MySql" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.Oracle" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.Postgres" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.Redshift" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.SqlAnywhere" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.SQLite" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.SqlServer" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.SqlServerCe" Version="3.2.11" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="5.0.2" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="5.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Primitives" Version="5.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="NUnit" Version="3.13.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.0.4" />
<PackageReference Include="SQLitePCLRaw.core" Version="2.0.4" />
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3" Version="2.0.4" />
<PackageReference Include="SQLitePCLRaw.provider.dynamic_cdecl" Version="2.0.4" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.2" />
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -5,6 +5,9 @@
<AssemblyName>Coscine.Migrations</AssemblyName>
<TargetFrameworks>net5.0;net461</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<None Remove="Migrations\Migration202101181145DFNAAI_up.sql" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Assets\dfg_structure.rdf" />
<EmbeddedResource Include="Assets\Institutes.csv" />
......@@ -12,50 +15,14 @@
<EmbeddedResource Include="Migrations\Migration202003121255ActivatedFeatures_up.sql" />
<EmbeddedResource Include="Migrations\Migration202005281400ProjectUrl_up.sql" />
<EmbeddedResource Include="Migrations\Migration202006261208ProjectQuotas_up.sql" />
<EmbeddedResource Include="Migrations\Migration202101181145DFNAAI_up.sql" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Consul" Version="1.6.1.1" />
<PackageReference Include="Coscine.Configuration" Version="*-*" />
<PackageReference Include="Coscine.Database.Helpers" Version="*-*" />
<PackageReference Include="FluentMigrator" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Abstractions" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Extensions.Oracle" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Extensions.Postgres" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Extensions.SqlAnywhere" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Extensions.SqlServer" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.Core" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.Db2" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.Firebird" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.Hana" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.Jet" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.MySql" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.Oracle" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.Postgres" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.Redshift" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.SqlAnywhere" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.SQLite" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.SqlServer" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.SqlServerCe" Version="3.2.11" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="5.0.2" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="5.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Primitives" Version="5.0.0" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.0.4" />
<PackageReference Include="SQLitePCLRaw.core" Version="2.0.4" />
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3" Version="2.0.4" />
<PackageReference Include="SQLitePCLRaw.provider.dynamic_cdecl" Version="2.0.4" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.2" />
<PackageReference Include="Coscine.Configuration" Version="1.6.0" />
<PackageReference Include="Coscine.Database.Helpers" Version="1.2.0" />
<PackageReference Include="FluentMigrator" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Extensions.SqlServer" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner" Version="3.2.11" />
<PackageReference Include="FluentMigrator.Runner.SqlServer" Version="3.2.11" />
</ItemGroup>
</Project>
\ No newline at end of file
using FluentMigrator;
namespace Coscine.Migrations.Migrations
{
//yyyymmddhhmm
[Migration(202101181145)]
public class Migration202101181145DFNAAI : FluentMigrator.Migration
{
public override void Down()
{
Delete.Column("Organization").FromTable("ExternalIds");
}
public override void Up()
{
Alter.Table("ExternalIds").AddColumn("Organization").AsString().Nullable();
Execute.EmbeddedScript("Migration202101181145DFNAAI_up.sql");
}
}
}
UPDATE ExternalIds
SET Organization = 'https://orcid.org/'
WHERE ExternalAuthenticatorId IN
(SELECT Id FROM ExternalAuthenticators WHERE
DisplayName = 'ORCiD');
UPDATE ExternalIds
SET Organization = 'https://login.rz.rwth-aachen.de/shibboleth'
WHERE ExternalAuthenticatorId IN
(SELECT Id FROM ExternalAuthenticators WHERE
DisplayName = 'Shibboleth');
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment