AnsweredAssumed Answered

Add additional table in database?

Question asked by nenad982 on Sep 30, 2014
Latest reply on Sep 30, 2014 by nenad982
Hi all,

I am currently using Alfresco Enterprise 4.2.2 and I would like to create an extension for Admin Console page. For that I need few additional tables in database and I would like to add these tables (if these do not already exist) to database on application start-up (after my custom repository amp installation which will include this sql script).

Does anybody know is it possible to do it and if yes some explanation would be nice?

I already tried to add my own sql script to the spring like this:



<bean id="patch.db-V4.2-add-new-table" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
        <property name="id"><value>patch.db-V4.2-add-new-table</value></property>
        <property name="description"><value>patch.db-V4.2-add-new-table.description</value></property>
        <property name="fixesFromSchema"><value>0</value></property>
        <property name="fixesToSchema"><value>6018</value></property>
        <property name="targetSchema"><value>6019</value></property>
        <property name="scriptUrl">
            <value>classpath:alfresco/extension/dbscripts/upgrade/4.2/${db.script.dialect}add-new-table.sql</value>
        </property>
    </bean>
   
    <bean id="schema.upgrade.sampleextension" class="org.alfresco.repo.domain.schema.SchemaBootstrapRegistration" init-method="register">
        <property name="schemaBootstrap" ref="schemaBootstrap" />
        <property name="postUpdateScriptPatches">
            <list>
                <ref bean="patch.db-V4.2-add-new-table" />
            </list>
        </property>
    </bean>



But on the next application start-up nothing happens. Does anybody has suggestion how to include this sql script in the amp and after amp installation this script to be automatically executed on the next application start-up?

Thanks…

Outcomes