Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • VICTORIA VILASINY 12 posts 82 karma points
    Sep 08, 2017 @ 12:24
    VICTORIA VILASINY
    0

    Custom table is not added to ucommerce database

    Hello Team, The custom table that i have added does not appear in uCommerce database.

    Here are the steps i followed

    1. I have created a separate class library application
    2. Added connection string in App.config, connection string named "connectionStringKey"
    3. Added a table name "Test" that inherits IEntity interface public virtual int Id { get; set; } public virtual string TestName { get; set; }
    4. A Map Class named "TestMap" public class TestMap:ClassMap
    5. A helper class and function to create session factory like this public static ISessionFactory CreateSessionFactory() { return Fluently.Configure() .Database(MsSqlConfiguration.MsSql2012 .ConnectionString(c => c.FromConnectionStringWithKey("connectionStringKey"))) .Mappings(m => m.FluentMappings.AddFromAssemblyOf
    6. added NihibernateMappingTag class public class NHibernateMappingTag: IContainsNHibernateMappingsTag { }
    7. In a program class added this method to create sessionfactory public void CreateTables() { using (var iSession = SessionHelper.CreateSessionFactory()){} }
    8. Referred this dll in our Installer application
    9. under umbraco/ucommerce created Apps folder under this Test Folder and added Mappings.config file and her added the component

    10. we have a class which is inheriting IPackageAction interface. In Execute method i am calling CreateTables method like this new CustomTables.Program().CreateTables();

    after doing all this i am building whole application and then deploying it on our umbraco site then building ucommerce store package then installing it form umbraco backoffice /developer /packages/install local

    Installation is success , but the custom table is not added into our ucommerce database

    Please help to fix this. I have already spent too much of time on this. Is there anything i am doing wrong or am i missing something ? guide me to fix this

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies