Issue with Module Installation

Topics: Writing modules
May 25, 2011 at 3:18 PM

I've developed a widget that works perfectly in one instance of Orchard. However, when I try any other instance, I continue to receive the exception "The specified table does not exist" when trying to add the widget to a content area. My datamigration file is pretty simplistic:

        public int Create() {
			// Creating table WeatherPartRecord
            SchemaBuilder.CreateTable("WeatherWidget", table => table
				.ContentPartRecord()
				.Column("webServiceUrl", DbType.String)
				.Column("searchString", DbType.String)
				.Column("partnerId", DbType.String)
				.Column("licenseKey", DbType.String)
                .Column("minutesToCache", DbType.Int32)
			);

            ContentDefinitionManager.AlterPartDefinition(typeof(WeatherWidgetPart).Name, cfg => cfg.Attachable());

            // Create a new widget content type with our map
            ContentDefinitionManager.AlterTypeDefinition("WeatherWidget", cfg => cfg
                .WithPart("WeatherWidgetPart")
                .WithPart("WidgetPart")
                .WithPart("CommonPart")
                .WithSetting("Stereotype", "Widget"));

            return 1;
        }

Any ideas?

May 25, 2011 at 3:52 PM

Your table should be called "WeatherWidgetPartRecord" not "WeatherWidget".