Hi Udara, We have done the same thing in EMM 1.1.0. However AFAIK there is no platform level solution for that. Please have a look at EMM-Utils <https://github.com/wso2-dev/product-emm/tree/master/modules/components/emm-utils> component. That's where we handle creation of EMM_DB when started server with -Dsetup flag.
Thanks, Best Regards, Lakshitha Harshan Software Engineer Mobile: *+94724423048* Email: [email protected] Blog : http://harshanliyanage.blogspot.com/ *WSO2, Inc. :** wso2.com <http://wso2.com/>* lean.enterprise.middleware. On Tue, Jul 22, 2014 at 2:16 PM, Udara Rathnayake <[email protected]> wrote: > Hi all, > > After moving the current social framework from Cassandra to SQL based > implementation I need to create a new data-source[1] and create related > table during initial server startup as well as start using the -Dsetup > flag. Since we maintain our own master-datasources.xml[2] I'm already done > with the first part. > > What is the best approach we can take to init the DB(create table etc..)? > I guess we have common platform wide approach for this. At the moment I > have h2, mysql and oracle related scripts. > > @Chan, > Can you explain the approach you take to init emm DB? > > [1] > > <datasource> > <name>WSO2_SOCIAL_DB</name> > <description>The datasource used for social framework > </description> > <jndiConfig> > <name>jdbc/WSO2SocialDB</name> > </jndiConfig> > <definition type="RDBMS"> > <configuration> > <url> > jdbc:h2:repository/database/WSO2SOCIAL_DB;DB_CLOSE_ON_EXIT=FALSE</url> > <username>wso2carbon</username> > <password>wso2carbon</password> > <driverClassName>org.h2.Driver</driverClassName> > <maxActive>50</maxActive> > <maxWait>60000</maxWait> > <testOnBorrow>true</testOnBorrow> > <validationQuery>SELECT 1</validationQuery> > <validationInterval>30000</validationInterval> > </configuration> > </definition> > </datasource> > > [2] > https://github.com/wso2/enterprise-store/blob/master/modules/distribution/src/repository/conf/datasources/master-datasources.xml > > Regards, > UdaraR > -- > *Udara Rathnayake* > Software Engineer > WSO2 Inc. : http://wso2.com > > Mobile : +94 772207239 > Twitter : http://twitter.com/udarakr > Blog : http://udarakr.blogspot.com > > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > >
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
