New field in custom module table is not updated

Topics: Troubleshooting
Dec 28, 2012 at 1:46 PM
Edited Dec 28, 2012 at 1:48 PM

Hi,

I have added a new field in my custom module table through:

1. Migrations.cs

public int UpdateFrom2()
{
      SchemaBuilder.AlterTable("SubscriberPartRecord", table => table
		  .AddColumn("TechnicalNews", System.Data.DbType.Int32)
	  );
		return 3;
}

2. And add the field in the below Models as well: SubscriberPart.cs SubscriberPartRecord.cs Results: 1. The new field created successfully in db, table. 2. The record for the specific module in table [Orchard_Framework_DataMigrationRecord] is Version 3. Issue: Upon update or create only the old fields are updated but not the new field. 

I checked in Orchard Logs and the new field is not shown anywere only the old ones. Please see below

the log file and let me know if there is anything that is missing.

1. IRepository _repository.Update 2. IContentManager _contentManager.Create

 

2012-12-28 15:25:02,556 [11] NHibernate.Impl.Printer - Orchard.ContentManagement.Records.ContentItemRecord{'Id'='1', 'Data'=null, 'Versions'='<uninitialized>', 'ThemeSiteSettingsPartRecord'='null', 
	'CKEditorSettingsPartRecord'='null', 'CacheSettingsPartRecord'='null', 'SiteSettings2PartRecord'='null', 'SiteSettingsPartRecord'='null', 'TagsPartRecord'='null', 'IdentityPartRecord'='null', 
	'CommonPartRecord'='null', 'WidgetPartRecord'='null', 'LayerPartRecord'='null', 'MenuPartRecord'='null', 'MenuItemPartRecord'='null', 'AdminMenuPartRecord'='null', 'RecentBlogPostsPartRecord'='null', 
	'BlogPartRecord'='null', 'BlogArchivesPartRecord'='null', 'CommentPartRecord'='null', 'CommentSettingsPartRecord'='null', 'CommentsPartRecord'='null', 'CustomPropertiesPartRecord'='null', 
	'FieldIndexPartRecord'='null', 'ProjectionPartRecord'='null', 'UserPartRecord'='null', 'RegistrationSettingsPartRecord'='null', 'SearchSettingsPartRecord'='null', 'WarmupSettingsPartRecord'='null', 
	'SubscriberPartRecord'='null', 'MenuStylingPartRecord'='null', 'MenuWidgetPartRecord'='null', 'AdvancedMenuItemPartRecord'='null', 'MenuSettingsPartRecord'='null', 'AdvancedMenuPartRecord'='null', 
	'ItemCounterPartRecord'='null', 'RecentlySeenPartRecord'='null', 'BreadcrumbsPartRecord'='null', 'MetaRecord'='null', 'CustomCssRecord'='null', 'FaviconSettingsPartRecord'='null', 
	'ContentType'='Orchard.ContentManagement.Records.ContentTypeRecord#1'}
2012-12-28 15:25:02,556 [11] NHibernate.Impl.Printer - SubscriberZone.Models.SubscriberPartRecord{'Id'='361', 'ContentItemRecord'='Orchard.ContentManagement.Records.ContentItemRecord#361', 
	'FirstName'='name', 'LastName'='aasdad', 'Email'='myemail@email.com', 'Active'='1', 'SystemId'=null, 'CompanyNews'='1'}
2012-12-28 15:25:02,556 [11] NHibernate.Impl.Printer - Orchard.Core.Settings.Metadata.Records.ContentTypeDefinitionRecord{'Id'='31', 'Name'='Subscriber', 'DisplayName'='Subscribers', 
	'Hidden'='False', 'Settings'='<settings ContentTypeSettings.Draftable="True" />', 'ContentTypePartDefinitionRecords'='['Orchard.Core.Settings.Metadata.Records.ContentTypePartDefinitionRecord#134', 
	'Orchard.Core.Settings.Metadata.Records.ContentTypePartDefinitionRecord#135']'}
2012-12-28 15:25:02,556 [11] NHibernate.Impl.Printer - Orchard.Core.Settings.Metadata.Records.ContentPartDefinitionRecord{'Id'='46', 'Name'='SubscriberPart', 'Hidden'='False', 
	'Settings'='<settings ContentPartSettings.Attachable="True" />', 'ContentPartFieldDefinitionRecords'='[]'}
2012-12-28 15:25:02,556 [11] NHibernate.Impl.Printer - Orchard.ContentManagement.Records.ContentTypeRecord{'Id'='32', 'Name'='Subscriber'}
2012-12-28 15:25:02,556 [11] NHibernate.Impl.Printer - Orchard.ContentManagement.Records.ContentItemRecord{'Id'='369', 'Data'=null, 
	'Versions'='['Orchard.ContentManagement.Records.ContentItemVersionRecord#1201']', 'ThemeSiteSettingsPartRecord'='null', 'CKEditorSettingsPartRecord'='null', 'CacheSettingsPartRecord'='null', 
	'SiteSettings2PartRecord'='null', 'SiteSettingsPartRecord'='null', 'TagsPartRecord'='null', 'IdentityPartRecord'='null', 'CommonPartRecord'='null', 'WidgetPartRecord'='null', 'LayerPartRecord'='null', 
	'MenuPartRecord'='null', 'MenuItemPartRecord'='null', 'AdminMenuPartRecord'='null', 'RecentBlogPostsPartRecord'='null', 'BlogPartRecord'='null', 'BlogArchivesPartRecord'='null', 
	'CommentPartRecord'='null', 'CommentSettingsPartRecord'='null', 'CommentsPartRecord'='null', 'CustomPropertiesPartRecord'='null', 'ContainerWidgetPartRecord'='null', 'ContainerPartRecord'='null', 
	'ContainablePartRecord'='null', 'MediaSettingsPartRecord'='null', 'LocalizationPartRecord'='null', 'QueryPartRecord'='null', 'FieldIndexPartRecord'='null', 'ProjectionPartRecord'='null', 
	'UserPartRecord'='null', 'RegistrationSettingsPartRecord'='null', 'SearchSettingsPartRecord'='null', 'WarmupSettingsPartRecord'='null', 'SubscriberPartRecord'='null', 'MenuStylingPartRecord'='null', 
	'MenuWidgetPartRecord'='null', 'AdvancedMenuItemPartRecord'='null', 'MenuSettingsPartRecord'='null', 'AdvancedMenuPartRecord'='null', 'ItemCounterPartRecord'='null', 'RecentlySeenPartRecord'='null', 
	'BreadcrumbsPartRecord'='null', 'MetaRecord'='null', 'CustomCssRecord'='null', 'FaviconSettingsPartRecord'='null', 'ContentType'='Orchard.ContentManagement.Records.ContentTypeRecord#32'}
2012-12-28 15:25:02,556 [11] NHibernate.Impl.Printer - SubscriberZone.Models.SubscriberPartRecord{'Id'='369', 'ContentItemRecord'='Orchard.ContentManagement.Records.ContentItemRecord#369', 
	'FirstName'='name', 'LastName'='aasdad', 'Email'='andreas22@gmail.com', 'Active'='0', 'SystemId'='d64671f5-b723-4032-8c2f-50a8700aa4de', 'CompanyNews'='1'}
2012-12-28 15:25:02,556 [11] NHibernate.Impl.Printer - Orchard.ContentManagement.Records.ContentItemRecord{'Id'='15', 'Data'=null, 'Versions'='<uninitialized>', 'ThemeSiteSettingsPartRecord'='null', 
	'CKEditorSettingsPartRecord'='null', 'CacheSettingsPartRecord'='null', 'SiteSettings2PartRecord'='null', 'SiteSettingsPartRecord'='null', 'TagsPartRecord'='null', 'IdentityPartRecord'='null', 
	'CommonPartRecord'='null', 'WidgetPartRecord'='null', 'LayerPartRecord'='null', 'MenuPartRecord'='null', 'MenuItemPartRecord'='null', 'AdminMenuPartRecord'='null', 'RecentBlogPostsPartRecord'='null', 
	'BlogPartRecord'='null', 'BlogArchivesPartRecord'='null', 'CommentPartRecord'='null', 'CommentSettingsPartRecord'='null', 'CommentsPartRecord'='null', 'CustomPropertiesPartRecord'='null', 
	'ContainerWidgetPartRecord'='null', 'ContainerPartRecord'='null', 'ContainablePartRecord'='null', 'MediaSettingsPartRecord'='null', 'LocalizationPartRecord'='null', 'QueryPartRecord'='null', 
	'FieldIndexPartRecord'='null', 'ProjectionPartRecord'='null', 'UserPartRecord'='null', 'RegistrationSettingsPartRecord'='null', 'SearchSettingsPartRecord'='null', 'WarmupSettingsPartRecord'='null', 
	'SubscriberPartRecord'='null', 'MenuStylingPartRecord'='null', 'MenuWidgetPartRecord'='null', 'AdvancedMenuItemPartRecord'='null', 'MenuSettingsPartRecord'='null', 'AdvancedMenuPartRecord'='null', 
	'ItemCounterPartRecord'='null', 'RecentlySeenPartRecord'='null', 'BreadcrumbsPartRecord'='null', 'MetaRecord'='null', 'CustomCssRecord'='null', 'FaviconSettingsPartRecord'='null', 
	'ContentType'='Orchard.ContentManagement.Records.ContentTypeRecord#9'}
2012-12-28 15:25:02,563 [11] NHibernate.Persister.Entity.AbstractEntityPersister - Inserting entity: [SubscriberZone.Models.SubscriberPartRecord#369]
2012-12-28 15:25:02,563 [11] NHibernate.AdoNet.AbstractBatcher - Building an IDbCommand object for the SqlString: INSERT INTO SubscriberZone_SubscriberPartRecord 
	(FirstName, LastName, Email, Active, SystemId, CompanyNews, Id) VALUES (?, ?, ?, ?, ?, ?, ?)
Coordinator
Dec 28, 2012 at 9:55 PM

Delete your mappings.bin file and restart the application.