Skip to content

Make the array of databases dynamic (configurable) via external call #3

Description

@suxstellino

Load the database list from an external call (API? JSON file?) instead of the current hard-coded implementation. This allows the tool to get the list of databases to manage dynamically.

#database scope settings (list of custom database "scope", scope is the "meaning" of the database and it needs the branch name for being a complete name)
$DB1Scope = 'DB1'
$DB2Scope = 'DB2'
$DB3Scope = 'DB3'
#database scripts (you can change the names of each script, and also the text within them)
$DB1CreationScript = '01 - Create database DB1.sql'
$DB2CreationScript = '02 - Create database DB2.sql'
$DB3CreationScript = '03 - Create database DB3.sql'
#endregion

#region WORKING VARIABLES

# list of needed database (specify the position = specify the sorting of scripts execution, if you need any)
$DB1Name = $DB1Scope+"_"+$BranchSuffix
$DB2Name = $DB2Scope+"_"+$BranchSuffix
$DB3Name = $DB3Scope+"_"+$BranchSuffix

$databases = (
        ($DB1Scope, $DB1Name, $DB1CreationScript, 1),
        ($DB2Scope, $DB2Name, $DB2CreationScript, 2),
        ($DB3Scope, $DB3Name, $DB3CreationScript, 3)
    )

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions