dynamically create table using orchard

Topics: Writing modules
Mar 5, 2013 at 5:37 PM
how can I dynamically create db table?

i tried this:
namespace YG.Tables.Services {
    public class MessageService : DataMigrationImpl, IMessageService
    {
        public void CreateMessagesTable()
        {
            /*throws "Object reference not set to an instance of an object."*/
            SchemaBuilder.CreateTable("MessagesTable"),
                table => table
                    .Column<int>("Id", column => column.PrimaryKey().Identity())
                    .Column<string>("Text")
                    .Column<DateTime>("Created")
                );
        }
    }
}
Developer
Mar 7, 2013 at 1:13 AM
Are you invoking that method yourself?
Mar 8, 2013 at 7:02 AM
Yes.
Developer
Mar 17, 2013 at 5:48 PM
So are you also instantiating this class yourself? If so, did you initialize the SchemaBuilder property?