OrchardCMS developers/users,
I have
public class MyContentPartRecord : ContentPartRecord
{ ... }
I want to change it to
public class MyContentPartRecord : ContentPartVersionRecord
{ ... }
In order to be able to create drafts for this part.
I add to Migraions
SchemaBuilder.AlterTable(
"MyContentPartRecord",
table =>
table
.AddColumn<int>("ContentItemRecord_id")
);
I run the app and the result is on get a content item of MyContentPart it creates an empty published version.
In db for MyContentPartRecord table:
Id [..fields..] ContentItemRecord_Id
657 NULL,.. 67
67 'MYDATA',... NULL
How to create a valid draftable MyContentPart?
UPDATE. I've tried with no success to add:
SchemaBuilder.ExecuteSql(@"
UPDATE MyContentPartRecord
SET ContentItemRecord_id = t2.ContentItemRecord_id
from MyContentPartRecord t1 inner join Orchard_Framework_ContentItemVersionRecord t2 on t1.id= t2.id
");
as it seems that orchard can't work with old records from MyContentPartRecord table as they don't have ContentItemRecord_id set.