Uploaded image for project: 'Atlas Module'
  1. Atlas Module
  2. ATLAS-184

Clean up database scripts

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: TBD
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Medium

      Description

      Rather than creating separate SQL scripts for every change needed to the database, let's aim for three SQL scripts: one to create the database, one to apply any updates, and one to populate with demo data. Since the docker container will execute these in alphabetic order, they should be prefixed with a number in the order they should be executed.

      • 01_database.sql – create the Atlas database schema
      • 02_updates.sql – apply any updates to the database
      • 03_demo_data.sql – load demo data into the database (could be used as default data for staging)

      We can drop support for past versions of the Atlas server and don't need to worry about supporting multiple versions at this time. In the future, if we want to support multiple versions of the Atlas server, would could append versions to the filenames for earlier versions (e.g., database.v3.sql).

      The current data.sql should be removed, since we should stop publishing real Atlas data in the repository.

      Ideally, all scripts should be idempotent – i.e., you get the same result even if a script is accidentally run multiple times. We can assume that the scripts are run in sequence: 01_database.sql first, then 02_updates.sql, then 03_demo_data.sql. In database.sql, it is idempotent already by dropping tables if they exist. In the updates.sql, we should test for existence of each change before applying it.

       

        Attachments

          Activity

            People

            Assignee:
            heliostrike Sai Sandeep Mutyala
            Reporter:
            burke Burke Mamlin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: