{"id":21384761,"url":"https://github.com/daaku/pgmig","last_synced_at":"2026-04-18T13:32:31.345Z","repository":{"id":62432227,"uuid":"287886498","full_name":"daaku/pgmig","owner":"daaku","description":"Database migrations for PostgreSQL on Clojure using next.jdbc.","archived":false,"fork":false,"pushed_at":"2021-10-28T12:42:50.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-25T09:00:58.636Z","etag":null,"topics":["clojure","database-migrations","postgresql"],"latest_commit_sha":null,"homepage":"https://cljdoc.org/d/daaku/pgmig","language":"Clojure","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/daaku.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}},"created_at":"2020-08-16T06:20:56.000Z","updated_at":"2021-10-28T12:42:52.000Z","dependencies_parsed_at":"2022-11-01T20:47:07.143Z","dependency_job_id":null,"html_url":"https://github.com/daaku/pgmig","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/daaku/pgmig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daaku%2Fpgmig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daaku%2Fpgmig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daaku%2Fpgmig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daaku%2Fpgmig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daaku","download_url":"https://codeload.github.com/daaku/pgmig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daaku%2Fpgmig/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268629720,"owners_count":24281172,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["clojure","database-migrations","postgresql"],"created_at":"2024-11-22T11:43:06.755Z","updated_at":"2026-04-18T13:32:26.325Z","avatar_url":"https://github.com/daaku.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"pgmig\n=====\n\nDatabase migrations for\n[next.jdbc](https://github.com/seancorfield/next-jdbc) and\n[PostgreSQL](https://www.postgresql.org/).\n\n\n[![Documentation](https://cljdoc.org/badge/daaku/pgmig)](https://cljdoc.org/d/daaku/pgmig/CURRENT)\n[![Clojars](https://img.shields.io/clojars/v/daaku/pgmig.svg)](https://clojars.org/daaku/pgmig)\n[![Build](https://github.com/daaku/pgmig/workflows/build/badge.svg)](https://github.com/daaku/pgmig/actions?query=workflow%3Abuild)\n\nDocumentation: https://cljdoc.org/d/daaku/pgmig\n\n## Usage\n\nMake a directory that contains your migrations. You can put this in your\n`resources` directory and load it from your `jar` if that makes\nsense. The library will run thru all the files in sorted order.\nThe suggested naming convention is `000_first.sql`, `001_second.sql` and so\non.\n\nThe library:\n\n 1. Will create a table named `pgmig_migrate` to manage the migration\n    state.\n 1. Will run everything in a single transaction, so all pending\n    migrations are run, or nothing.\n 1. Expects you to never delete or rename a migration.\n 1. Expects you to not put a new migration between two existing ones.\n 1. Expects file names and contents to be UTF-8.\n 1. There are no rollbacks - just write a new migration.\n\nTo use it:\n\n```clojure\n(ns myapp\n  (:require [clojure.java.io :as io]\n            [daaku.pgmig :as pgmig]))\n\n(def db-spec {:dbtype \"postgres\" :dbname \"myapp\"})\n\n(def migrations\n  (delay (pgmig/migrations-from-dir (io/resource \"myapp/migrations\"))))\n\n(defn start []\n  (pgmig/migrate db-spec @migrations))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaaku%2Fpgmig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaaku%2Fpgmig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaaku%2Fpgmig/lists"}