Skip to content

Commit 13b7d52

Browse files
Got things compiling
1 parent 599d492 commit 13b7d52

18 files changed

+68
-217
lines changed

src/Our.Umbraco.AuthU/Component/MigrationsRunnerComponent.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using Umbraco.Core.Migrations.Upgrade;
66
using Umbraco.Core.Scoping;
77
using Umbraco.Core.Services;
8-
using Our.Umbraco.AuthU.Data.Migrations.Plans;
8+
using Our.Umbraco.AuthU.Data.Migrations;
99

1010
namespace Our.Umbraco.AuthU.Component
1111
{
@@ -32,8 +32,8 @@ public void Initialize()
3232
{
3333
try
3434
{
35-
//Create the oAuth tables
36-
var upgrader = new Upgrader(new RegisterOAuthTables());
35+
var plan = new AuthUMigrationPlan();
36+
var upgrader = new Upgrader(plan);
3737

3838
upgrader.Execute(_scopeProvider, _migrationBuilder, _keyValueService, _logger);
3939
}
@@ -44,8 +44,6 @@ public void Initialize()
4444
}
4545

4646
public void Terminate()
47-
{
48-
49-
}
47+
{ }
5048
}
5149
}

src/Our.Umbraco.AuthU/Composer/MigrationRunnerComposer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ namespace Our.Umbraco.AuthU.Composer
77
/// <summary>
88
/// This class registers components at umbraco start up.
99
/// </summary>
10-
class MigrationRunnerComposer : IUserComposer
10+
internal class MigrationRunnerComposer : IUserComposer
1111
{
1212
public void Compose(Composition composition)
1313
{
14-
//Registers the Migrations Runner component, this creates the tables
15-
//required for the oAuth stores.
14+
// Registers the Migrations Runner component, this creates the tables
15+
// required for the oAuth stores.
1616
composition.Components().Append<MigrationsRunnerComponent>();
1717
}
1818
}

src/Our.Umbraco.AuthU/Data/Helpers/AuthUKeyValueHelper.cs

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/Our.Umbraco.AuthU/Data/Migrations/UmbracoDbOAuthRefreshTokenStore/Add/AddDeviceIdColumn.cs renamed to src/Our.Umbraco.AuthU/Data/Migrations/AddDeviceIdColumnToOAuthRefreshTokenTable.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
using Umbraco.Core.Migrations;
22

3-
namespace Our.Umbraco.AuthU.Data.Migrations.UmbracoDbOAuthRefreshTokenStore
3+
namespace Our.Umbraco.AuthU.Data.Migrations
44
{
55
/// <summary>
66
/// Simple migration to create the DeviceId column on the OAuthRefreshToken Table
77
/// </summary>
8-
internal class AddDeviceIdColumn : MigrationBase
8+
internal class AddDeviceIdColumnToOAuthRefreshTokenTable : MigrationBase
99
{
10-
public AddDeviceIdColumn(IMigrationContext context) : base(context)
10+
public AddDeviceIdColumnToOAuthRefreshTokenTable(IMigrationContext context) : base(context)
1111
{ }
1212

1313
public override void Migrate()
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using Umbraco.Core.Migrations;
2+
3+
namespace Our.Umbraco.AuthU.Data.Migrations
4+
{
5+
/// <summary>
6+
/// This is the plan that runs the AuthU Migrations
7+
/// </summary>
8+
internal class AuthUMigrationPlan : MigrationPlan
9+
{
10+
/// <summary>
11+
/// Add the demo id if preferred
12+
/// </summary>
13+
/// <param name="CreateDemoClient"></param>
14+
public AuthUMigrationPlan() : base("AuthU")
15+
{
16+
From(InitialState)
17+
.To<CreateOAuthClientTable>("CreateOAuthClientTable")
18+
.To<CreateOAuthRefreshTokenTable>("CreateOAuthRefreshTokenTable")
19+
.To<AddDeviceIdColumnToOAuthRefreshTokenTable>("AddDeviceIdColumnToOAuthRefreshTokenTable")
20+
.To<CreateDemoOAuthClient>("CreateDemoOAuthClient");
21+
}
22+
23+
/// <summary>
24+
/// Using the helper method to get the AuthU Key 'Umbraco.Core.Upgrader.State+AuthU' Value
25+
/// </summary>
26+
public override string InitialState => string.Empty;
27+
}
28+
}

src/Our.Umbraco.AuthU/Data/Migrations/UmbracoDbOAuthClientStore/CreateDemoClient.cs renamed to src/Our.Umbraco.AuthU/Data/Migrations/CreateDemoOAuthClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
using Our.Umbraco.AuthU.Models;
22
using Umbraco.Core.Migrations;
33

4-
namespace Our.Umbraco.AuthU.Data.Migrations.UmbracoDbOAuthClientStore
4+
namespace Our.Umbraco.AuthU.Data.Migrations
55
{
66
/// <summary>
77
/// Simple migration to add a demo client to the OAuthClient Table
88
/// </summary>
9-
internal class CreateDemoClient : MigrationBase
9+
internal class CreateDemoOAuthClient : MigrationBase
1010
{
11-
public CreateDemoClient(IMigrationContext context) : base(context)
11+
public CreateDemoOAuthClient(IMigrationContext context) : base(context)
1212
{ }
1313

1414
public override void Migrate()

src/Our.Umbraco.AuthU/Data/Migrations/UmbracoDbOAuthClientStore/Add/CreateAuthClientStoreTable.cs renamed to src/Our.Umbraco.AuthU/Data/Migrations/CreateOAuthClientTable.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
using Our.Umbraco.AuthU.Models;
22
using Umbraco.Core.Migrations;
33

4-
namespace Our.Umbraco.AuthU.Data.Migrations.UmbracoDbOAuthClientStore
4+
namespace Our.Umbraco.AuthU.Data.Migrations
55
{
66
/// <summary>
77
/// Simple migration to create the OAuthClient Table
88
/// </summary>
9-
internal class CreateAuthClientStoreTable : MigrationBase
9+
internal class CreateOAuthClientTable : MigrationBase
1010
{
11-
public CreateAuthClientStoreTable(IMigrationContext context)
11+
public CreateOAuthClientTable(IMigrationContext context)
1212
: base(context)
1313
{ }
1414

src/Our.Umbraco.AuthU/Data/Migrations/UmbracoDbOAuthRefreshTokenStore/Add/CreateAuthRefreshTokenStoreTable.cs renamed to src/Our.Umbraco.AuthU/Data/Migrations/CreateOAuthRefreshTokenTable.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
using Our.Umbraco.AuthU.Models;
22
using Umbraco.Core.Migrations;
33

4-
namespace Our.Umbraco.AuthU.Data.Migrations.UmbracoDbOAuthRefreshTokenStore
4+
namespace Our.Umbraco.AuthU.Data.Migrations
55
{
66
/// <summary>
77
/// Simple migration to create the OAuthRefreshToken Table
88
/// </summary>
9-
internal class CreateAuthRefreshTokenStoreTable : MigrationBase
9+
internal class CreateOAuthRefreshTokenTable : MigrationBase
1010
{
11-
public CreateAuthRefreshTokenStoreTable(IMigrationContext context) : base(context)
11+
public CreateOAuthRefreshTokenTable(IMigrationContext context) : base(context)
1212
{ }
1313

1414
public override void Migrate()

src/Our.Umbraco.AuthU/Data/Migrations/UmbracoDbOAuthClientStore/Add/CreateDemoClient.cs

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/Our.Umbraco.AuthU/Data/Migrations/UmbracoDbOAuthClientStore/CreateAuthClientStoreTable.cs

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)