{"id":37154344,"url":"https://github.com/meehow/rambler","last_synced_at":"2026-01-14T18:12:24.768Z","repository":{"id":57587028,"uuid":"72203347","full_name":"meehow/rambler","owner":"meehow","description":"A simple and language-independant SQL schema migration tool","archived":false,"fork":true,"pushed_at":"2016-10-27T12:15:40.000Z","size":2736,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T12:42:00.931Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"elwinar/rambler","license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meehow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-28T11:52:58.000Z","updated_at":"2016-10-28T11:52:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/meehow/rambler","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/meehow/rambler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meehow%2Frambler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meehow%2Frambler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meehow%2Frambler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meehow%2Frambler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meehow","download_url":"https://codeload.github.com/meehow/rambler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meehow%2Frambler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28429949,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T18:12:21.966Z","updated_at":"2026-01-14T18:12:24.760Z","avatar_url":"https://github.com/meehow.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rambler [![build](https://app.wercker.com/status/b645428b6f548288d71d3ba83cc1a783/s/master \"wercker status\")](https://app.wercker.com/project/bykey/b645428b6f548288d71d3ba83cc1a783) [![Coverage Status](https://coveralls.io/repos/elwinar/rambler/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/elwinar/rambler?branch=master)\n\nA simple and language-independent SQL schema migration tool\n\n## Installation\n\nYou can download the latest release on the [release page](https://github.com/elwinar/rambler/releases) of the project.\n\nGo users can also simply compile it from source and install it as a go executable using the following command :\n\n```\ngo install github.com/elwinar/rambler\n```\n\nReleases are compiled using the wonderful [XGo](https://github.com/karalabe/xgo). Don't hesitate to check it out, it really kicks some serious ass.\n\n## Usage\n\n### Migrations\n\nIn rambler, migrations are kept in the simplest form possible: a migration is a list of sections (`up` and `down`), each section being an SQL statement. Example:\n\n```sql\n-- rambler up\n\nCREATE TABLE foo (\n\tid INTEGER UNSIGNED AUTO_INCREMENT,\n\tbar VARCHAR(60),\n\tPRIMARY KEY (id)\n);\n\n-- rambler down\n\nDROP TABLE foo;\n```\n\nSections are delimited by SQL comments sufixed by the rambler marker (white-spaces sensitive). While applying a migration, rambler will execute each `up` section in order, and while reversing it it will execute each `down` section in reverse order.\n\nMigrations are executed in alphabetical order, thus a versionning scheme of the form `version_description.sql` is highly recommended, version being an integer value, and description an underscored string. Examples:\n\n* `201409272258_Added_table_foo.sql`\n* `01_First_migration.sql`\n\n### Configuration\n\nRambler configuration is lightweight: just dump the credentials of your database and the path to your migrations' directory into a JSON file, and you're done. Here is an example or JSON configuration file with the default values of rambler:\n\n```json\n{\n\t\"driver\": \"mysql\",\n\t\"protocol\": \"tcp\",\n\t\"host\": \"localhost\",\n\t\"port\": 3306,\n\t\"user\": \"root\",\n\t\"password\": \"\",\n\t\"database\": \"\",\n\t\"directory\": \".\"\n}\n```\n\nWhen running, rambler will try to find a configuration file in the working directory and use its values to connect to the managed database.\n\n#### HJSON\n\nRambler now supports [HJSON](http://hjson.org/) configuration files, which is by the way retrocompatible with JSON.\n\n#### Drivers\n\nRambler supports actually 3 drivers:\n\n- `mysql`\n- `postgresql`\n- `sqlite`\n\nDon't hesitate to get in touch if you want to see another one supported, provided a golang `database/sql` driver exist for your database vendor.\n\n### Applying a migration\n\nTo apply a migration, use the `apply` command.\n\n```\nrambler apply\n```\n\nRambler will compare the migrations already applied and the available migrations in increasing order to find the next migration to apply, then execute all its `up` sections' statements in order. \n\n### Reversing a migration\n\nTo reverse a migration, use the `reverse` command.\n\n```\nrambler reverse\n```\n\nRambler will compare the migrations already applied and the available migrations in decreasing order to find the last applied migrations, then execute all its `down` sections' statements in reverse order.\n\n### Options\n\nYou can tell rambler to repeat the process while there is a migration to apply (or reverse) with the `all` flag (or its shorthand, `a`).\n\n### Errors\n\nTo ensure database schema consistency, rambler will complain and stop when encountering a new migration in the middle of the already existing ones or if it can't find a migration already applied.\n\n### Environments\n\nAn environment is an additionnal configuration that is given a name, and can be used to create multiple configurations for a single application (for example, to differenciate production, testing, etc).\n\nEnvironments are defined in the configuration file, under the `environments` item.\nEach environment is defined as an attribute of this item, the key being the name and the value being the configuration options.\n\nEnvironments configuration are derived from the default configuration of rambler (at the configuration file's root), so you only need to override the needed options:\n\n```json\n{\n\t\"driver\": \"mysql\",\n\t\"protocol\": \"tcp\",\n\t\"port\": 3306,\n\t\"user\": \"root\",\n\t\"password\": \"\",\n\t\"database\": \"rambler_default\",\n\t\"directory\": \"migrations\",\n\t\"environments\": {\n\t\t\"development\": {\n\t\t\t\"database\": \"rambler_development\"\n\t\t},\n\t\t\"testing\": {\n\t\t\t\"database\": \"rambler_testing\"\n\t\t}\n\t}\n}\n```\n\nHere we have three environments defined:\n- `default`, will use the `rambler_default` database,\n- `development`, will use the `rambler_development` database,\n- `testing`, will use the `rambler_testing` database;\n\n## CONTRIBUTORS\n\n- [cjhubert](https://github.com/cjhubert)\n- [shawndellysse](https://github.com/shawndellysse)\n\n## Feedback and contributions\n\nFeel free to give feedback, make pull requests or simply open issues if you find a bug or have an idea.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeehow%2Frambler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeehow%2Frambler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeehow%2Frambler/lists"}