This is a set of scripts demonstrate usage of Rumba[rdbm] by DBinvent.
Rumba is a database schema migration tool for PostgreSQL that helps manage, control and deploy database schema changes across various environments and development stages.
It employs the automatic SQL generation and plain-SQL approach in one software. Scripts can be assigned with a version and a certain migration phase, which brings developers true flexibility to perform the action at an exact migration stage.
- create database and user if absent
- use both: schema/table definition and script execution tracking
- simple ETL for extraction on snapshot AND do load data on migration
- support separate db connection for history table as a remote copy or primary one
- use psql client for script execution, include native psql script support with transaction control
- no JVM nor Python required to run
- lightweight (just about 10MB) with apt repo to stay updated
- transactional changes with rollback OR use configurable non-transactional mode
- dry run and diff with existing DB
- free personal license
Every usecase perform migration and YAML & SQL dump to compare with expected result.
- Baseline Test license and perform a self migration.
- Create DB Test Create User(role) and Database on demand.
- Simple migration Simple migration with tracking versioned YAML and SQL script
- Versioned YAML schemas migration Multiple YAML scripts with staged migration
- Versioned SQL migration Multiple SQL scripts with staged migration
- StoredProc Repeatable migration useful for Stored Procedures or Function
- Complex Mixed YAML Schemas, SQL, Triggers and Pre Deploy SQL
- Simple example of ETL: Extract-Transform-Load: 1, 2, 3 with the schema migration
- ETL: mixes SQL and CSV Mixing data sourcing from plain SQL and CSV
- Tag and User Add tagging and user info into migration
- Dry Run Show generated SQL code without real execution
- Log DB Copy Deployment history journal to another DB
- URL Use single param DB_URL for a connection configuration
- ENV Use environment variables override
[Type][Version]__[script_name].[yaml|sql|csv]
- Type - Single Capital Letter one of: P,S,V,R,D or 'a' for 'after'
- Version - one or more digits number divided by _, which will be replaced to dot. Ex: 1_2 will be 1.2.0
- The script name - any mean-full name of the script file
- File type: yaml, sql or csv
- P - The PreDeploy SQL is to be executed before (S)chema YAML.
- S - The Schema YAML will try to scan an information DB and apply changes required. The 'D' type will be executed there as well -- see bellow.
- V - The Version SQL is intended to be a major set of files for DB upgrade and will be executed only one time and be stored into a history log table.
- R - The Re-runnable (mutable) SQL is very useful for handling stored procedure upgrades, and with a '--script_tag' is easily trackable. The file type 'D' for data in CSV format deployed as a part of S by define the file in YAML. See ETL
See for more details
Get a list of all available test cases:
./test.sh
./test.sh baseline # or any other usecase your prefer to run
./test.sh baseline psql
So, you can check generated tables and history journal.
./test.sh baseline bash
Very useful to play with preconfigured rdbm app. Try: rdbm help