Does XL Deploy support Fluent Migrator?

95 Views Asked by At

I want to use Fluent Migrator for database migrations for my .net project. Anyone has success stories of Fluent Migrator integrated with XL Deploy for database deployment?

Regards, Pandian.

1

There are 1 best solutions below

0
On

This can be done through customizations Using XLDeploy Rules You need first to have your migration script which will be have steps needed to run for migrating your database.

Then you need to add or modify the following files in the ext folder of the XL Deploy server:

1- synthetic.xml, which will contain the configuration item (CI) types that are defined .. Those will be for example contain parameters you need to pass to your script like below,

<type type="MigrateDB.DeployedScripts" extends="udm.BaseDeployedArtifact" deployable-type="MigrateDB.Scripts" container-type="MigrateDB.Runner">
    <property name="username"
          kind="string"
          required="false"
          description="The user to use to connect to the database."/>
    <property name="password"
          kind="string"
          required="false"
          password="true"
          description="The password to use to connect to the database."/>
    <property name="schemas"
          kind="set_of_string"
          required="true"
          description="list of schemas."/>
</type>

2- xl-rules.xml, which will contain the rules that are defined

First you define when you need this rule to run like while you are doing initial deployment or update through setting condition like below

<conditions>
    <type>MigrateDB.DeployedScripts</type>
    <operation>CREATE</operation>
    <operation>MODIFY</operation>
</conditions>

Then you can define location of your migration script which will be relative to ext directory like below,

<jython>
    <description expression="true">"Run migration"</description>
    <order>50</order>
    <script-path>MigratDB/run-migration.py</script-path>
</jython>

Make sure to restart XLDeploy service after applying those changes .. You may have a look how this plugin xld-flyway-plugin is created .. you can also try to discover and use it by placing it's jar under plugins directory.