{"id":37564027,"url":"https://github.com/dfds/pgup","last_synced_at":"2026-01-16T09:12:03.808Z","repository":{"id":97567391,"uuid":"157119668","full_name":"dfds/pgup","owner":"dfds","description":"Archived","archived":false,"fork":false,"pushed_at":"2024-07-31T08:54:14.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-07-31T10:09:25.351Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/dfds.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-11-11T20:47:21.000Z","updated_at":"2024-07-31T08:52:29.000Z","dependencies_parsed_at":"2024-04-04T13:27:30.024Z","dependency_job_id":"e52a1da0-898b-4b13-a243-9f6f149c2316","html_url":"https://github.com/dfds/pgup","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/dfds/pgup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfds%2Fpgup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfds%2Fpgup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfds%2Fpgup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfds%2Fpgup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfds","download_url":"https://codeload.github.com/dfds/pgup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfds%2Fpgup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: 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-16T09:12:02.926Z","updated_at":"2026-01-16T09:12:03.780Z","avatar_url":"https://github.com/dfds.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :warning: ~Repository not maintained~ :warning:\n\n*as of 22FEB24: Image built from this repo seems to do the bare minimum it's expected to do*\n\nPlease note that this repository is no longer being maintained.\n\n- It may contain code, or reference dependencies, with known vulnerabilities\n- It may contain out-dated advice, how-to's or other forms of documentation\n\nThe contents might still serve as a source of inspiration, but please review any contents before reusing elsewhere.\n\n# Postgres Database Migration\n\n## Installation\n\n### Bash\n\nThe following will download the latest version:\n\n```\ncurl -sSL https://raw.githubusercontent.com/dfds/pgup/master/install.sh | sh -s -\n```\n\n## Notes on building `Dockerfile`\n\nWhen building the docker image `update-ca-certificates` may cause warnings, it should not be an issue according to https://github.com/gliderlabs/docker-alpine/issues/30\n\n## Layout\n\n```bash\n/db\n┣ migrations/\n┃ ┣ 20181017194326_create_team_table.sql\n┃ ┣ 20181017194336_create_user_table.sql\n┃ ┗ 20181017194344_create_membership_table.sql\n┗ seed/\n  ┣ _order\n  ┣ Membership.csv\n  ┣ Team.csv\n  ┗ User.csv\n```\n\nUsing:\n\n```bash\n./add-migrations.sh this is the latest and greatest migration\n```\n\nto add a new migration script. Will result in a new script file being created in `db/migrations/yyyymmddhhmmss_this_is_the_latest_and_greatest_migration.sql` where yyyymmddhhmmss is the current local timestamp.\n\n## Environment Variables\n\n| Name               | Required | Default     | Comment                                                                      |\n| ------------------ | :------: | ----------- | ---------------------------------------------------------------------------- |\n| PGDATABASE         |   YES    | n/a         | **MUST** be set to the name of the database                                  |\n| PGHOST             |   YES    | n/a         | **MUST** be set to the host (url/ip)                                         |\n| PGPORT             |    -     | 5432        | **MAY** be overridden to use a different port                                |\n| PGUSER             |   YES    | n/a         | **MUST** be set to the database user                                         |\n| PGPASSWORD         |   YES    | n/a         | **MUST** be set to the database user password                                |\n| PGSSLMODE          |    -     | verify-full | **MAY** be set to _disable_ for local development                            |\n| DEBUG              |    -     | _unset_     | **MAY** be set to any value (=1) to enable script debugging                  |\n| LOCAL_DEVELOPMENT  |    -     | _unset_     | **MAY** be set to any value (=1) for local development (see below)           |\n| SEED_CSV_SEPARATOR |    -     | ,           | **MAY** be overriden to allow for a different seperator for seeding from csv |\n\n## Local development\n\nRun\n\n```bash\ndocker-compose up --build\n```\n\nChange the environment values in the `docker-compose.yml` file.\n\n- Enable local development using `LOCAL_DEVELOPMENT=1`.\n  - Will recreate the database from scratch and run any migrations as well as seed the database.\n- Disable SSL mode using `PGSSLMODE=disable`.\n\n### Seeding\n\nTo seed the database for local development:\n\n1. create a `seed` folder in the `db` folder, according to the layout above.\n1. create one or more `.csv` files\n   - the name of the file must match a table in the database (remember Postgres is case-sensitive like Linux).\n   - file **must** contain a header\n   - all fields (including headers) **must** be separated by commas (`,`).\n   - fields **must** be in the same order as the columns in the table schema.\n1. create an `_order` file\n   - each line **must** contain the name of the CSV-files from the previous step.\n   - **only** include the name of the file (case-sensitive and with extension), **not** the path.\n\n_To seed the database for production use is out-of-scope for this README, but consider using regular migration scripts and insert statements, or restoring a prepopulated database._\n\n### Debugging\n\n- Enable debugging by setting environment variable `DEBUG` (e.g. `DEBUG=1`).\n- To inspect the final generated migration script it is possible to mount a volumne to `/tmp` in the docker container, like:\n  ```yaml\n  volumes:\n    - ${PWD}/db/output:/tmp\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfds%2Fpgup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfds%2Fpgup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfds%2Fpgup/lists"}