documentStore changes not reflected to table structure



  • Hi,

    I'm using JSReport with the jsreport-mssql-storage Plugin.
    With a custom plugin I'm trying to add another data-field to the "Reports" entity, like so:

        reporter.documentStore.model.entityTypes['ReportType'].myTest3 = {
            type: 'Edm.String'
        };
    

    When starting the render process, I'm doing something like this:

    jsReport.render({
        template: { _id: invocation.parameters.template.id },
        data: invocation.parameters.data,
        options: {
            reports: {
                save: true,
                async: false,
                mergeProperties: {
                    myTest3: 'a'
                }
            }
        }
    });
    

    This works if I start JSReport with a "clean" database. The "jsreport_ReportType" Table gets created along with the "myTest3" column (in the database).

    But doing this with an "existing" database (where my custom data was not specified in the beginning), gives an error, that the Column "myTest3" was not found.

    For me it looks like, that there is no migration strategy for the documentStore.
    Am I right with this assumption?
    If so, what is the desired way to add properties to entityType?

    Best Regards
    Jens



  • For me it looks like, that there is no migration strategy for the documentStore.

    Yes, that is correct. jsreport SQL stores don't produce change scripts and aren't able to migrate existing databases.

    You need to write your own change scripts and apply them. Or drop the table and let it reinitialize by jsreport. I believe one line change script is the easiest for you in this case.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.