{"id":21929942,"url":"https://github.com/scotttesler/migurt","last_synced_at":"2025-08-22T00:10:25.596Z","repository":{"id":53954778,"uuid":"134097839","full_name":"scotttesler/migurt","owner":"scotttesler","description":"🍦A database migration and seeding tool.","archived":false,"fork":false,"pushed_at":"2024-06-16T09:54:18.000Z","size":170,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-07T12:09:06.181Z","etag":null,"topics":["database","database-management","database-migrations","databases","migration","migration-tool","migrations","migrationtool","postgres","postgres-database","postgresql","postgresql-database","relational-databases","sql"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scotttesler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-19T21:03:25.000Z","updated_at":"2023-03-20T00:18:46.000Z","dependencies_parsed_at":"2024-11-27T10:40:34.434Z","dependency_job_id":null,"html_url":"https://github.com/scotttesler/migurt","commit_stats":{"total_commits":72,"total_committers":4,"mean_commits":18.0,"dds":"0.20833333333333337","last_synced_commit":"4bde58110d7cd61b030b642b89a3138a70f9bdf4"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scotttesler%2Fmigurt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scotttesler%2Fmigurt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scotttesler%2Fmigurt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scotttesler%2Fmigurt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scotttesler","download_url":"https://codeload.github.com/scotttesler/migurt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249769891,"owners_count":21323067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["database","database-management","database-migrations","databases","migration","migration-tool","migrations","migrationtool","postgres","postgres-database","postgresql","postgresql-database","relational-databases","sql"],"created_at":"2024-11-28T23:06:34.768Z","updated_at":"2025-04-19T18:53:06.288Z","avatar_url":"https://github.com/scotttesler.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# migurt 🍦\n\n_A database migration tool_\n\n[![Build Status](https://travis-ci.org/scotttesler/migurt.svg?branch=master)](https://travis-ci.org/scotttesler/migurt \"Build status\")\n[![JavaScript Style Guide: Prettier](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg?style=flat)](https://github.com/prettier/prettier \"Prettier\")\n\nMigurt lets you write database migrations and seeds in your database's language.\n\n(Currently, only works with [PostgreSQL](https://www.postgresql.org/))\n\n## Installation\n\n`npm i -g migurt`\n\n## Usage\n\n### `migurt help [COMMAND]`\n\nDisplays help.\n\n`[COMMAND]` - _Optional_. The name of a command.\n\n---\n\n### `migurt create-migration --name \u003cNAME\u003e`\n\nCreate new migration and matching reversion files.\n\n`\u003cNAME\u003e` - **Required**. The name of the migration file. Prefixed to the name\nwill be a timestamp. Suffixed to the name will be \".sql\".\n\n#### Example\n\n```\nmigurt create-migration --name create_table_companies\n```\n\nwill create files `./db/migrations/up/1525396716884_create_table_companies.sql`\nand `./db/migrations/down/1525396716884_create_table_companies.sql` (creating\nthe directories if they don't exist).\n\nNow, write your migrations in PostgreSQL. For example\n\n```sql\n-- ./db/migrations/up/1525396716884_create_table_companies.sql\n\nCREATE TABLE public.companies (\n  id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),\n  name TEXT NOT NULL UNIQUE,\n  active BOOLEAN NOT NULL DEFAULT TRUE\n);\n\nCREATE UNIQUE INDEX companies_id_idx ON public.companies (id);\nCREATE UNIQUE INDEX companies_name_idx ON public.companies (name);\nCREATE INDEX companies_active_idx ON public.companies (active);\n```\n\n```sql\n-- ./db/migrations/down/1525396716884_create_table_companies.sql\n\nDROP TABLE public.companies;\n```\n\n---\n\n### `migurt create-seed --name \u003cNAME\u003e`\n\nCreate new seed and matching reversion files.\n\n`\u003cNAME\u003e` - **Required**. The name of the seed file. Prefixed to the name will be\na timestamp. Suffixed to the name will be \".sql\".\n\n#### Example\n\n```\nmigurt create-seed --name create_companies\n```\n\nwill create files `./db/seeds/up/1526829902471_create_companies.sql`\nand `./db/seeds/down/1526829902471_create_companies.sql` (creating\nthe directories if they don't exist).\n\nNow, write your seeds in PostgreSQL. For example\n\n```sql\n-- ./db/seeds/up/1526829902471_create_companies.sql\n\nINSERT INTO public.companies (name) VALUES ('E Corp');\n```\n\n```sql\n-- ./db/seeds/down/1526829902471_create_companies.sql\n\nDELETE FROM public.companies WHERE name = 'E Corp';\n```\n\n---\n\n### `migurt migrate --number \u003cNUMBER\u003e`\n\nRun migrations.\n\n`\u003cNUMBER\u003e` - **Required**. The number of migrations to run. Enter a number to\nrun that many migrations from the last ran migration.\n\n---\n\n### `migurt seed --number \u003cNUMBER\u003e`\n\nRun seeds.\n\n`\u003cNUMBER\u003e` - **Required**. The number of seeds to run. Enter a number to run\nthat many seeds from the last ran seed.\n\n---\n\n### `migurt revert-migrations --number \u003cNUMBER\u003e`\n\nRevert migrations.\n\n`\u003cNUMBER\u003e` - **Required**. The number of migrations to revert. Enter a number to\nrevert that many migrations from the latest.\n\n---\n\n### `migurt revert-seeds --number \u003cNUMBER\u003e`\n\nRevert seeds.\n\n`\u003cNUMBER\u003e` - **Required**. The number of seeds to revert. Enter a number to\nrevert that many seeds from the latest.\n\n---\n\n## Configuration\n\nmigurt parses environment variables from a `.env` file when\n`process.env.NODE_ENV != 'production'`.\n\nBelow are the environment variables and their defaults.\n\nNOTE: `DATABASE_URL` is required.\n\n```javascript\nDATABASE_URL=\nDIRECTORY_DOWN_MIGRATIONS=\"./db/migrations/down\"\nDIRECTORY_DOWN_SEEDS=\"./db/seeds/down\"\nDIRECTORY_UP_MIGRATIONS=\"./db/migrations/up\"\nDIRECTORY_UP_SEEDS=\"./db/seeds/up\"\nTABLE_NAME_MIGRATIONS=\"public.migrations\"\nTABLE_NAME_SEEDS=\"public.seeds\"\n```\n\n## TODO\n\n- [ ] Add MySQL support.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscotttesler%2Fmigurt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscotttesler%2Fmigurt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscotttesler%2Fmigurt/lists"}