-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDotpayMigrations.cs
More file actions
34 lines (30 loc) · 1.32 KB
/
DotpayMigrations.cs
File metadata and controls
34 lines (30 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using KoLiber.Module.Widgets.Models;
using Orchard.ContentManagement.MetaData;
using Orchard.Core.Contents.Extensions;
using Orchard.Data.Migration;
using Orchard.Environment.Extensions;
// This code was generated by Orchardizer
namespace KoLiber.Module.Widgets
{
[OrchardFeature(Consts.DotpayFeatureID)]
public class DotpayMigrations : DataMigrationImpl {
public int Create() {
ContentDefinitionManager.AlterPartDefinition(nameof(DotpayDonationFormPart), builder => builder
.Attachable()
.WithDescription("Allows users to send donations via dotpay.pl")
);
SchemaBuilder.CreateTable(nameof(DotpayDonationFormPartRecord), table => table
.ContentPartRecord()
.Column<int>(nameof(DotpayDonationFormPartRecord.DotpayId))
.Column<double>(nameof(DotpayDonationFormPartRecord.SuggestedAmount), col => col.Nullable())
.Column<string>(nameof(DotpayDonationFormPartRecord.Purpose))
.Column<string>(nameof(DotpayDonationFormPartRecord.ReturnUrl))
);
ContentDefinitionManager.AlterTypeDefinition(Consts.DotpayWidgetName, type => type
.AsWidget()
.WithPart(nameof(DotpayDonationFormPart))
);
return 1;
}
}
}