{"id":26578013,"url":"https://github.com/fredimatteo/migratron","last_synced_at":"2025-03-23T04:18:26.147Z","repository":{"id":283844326,"uuid":"951371881","full_name":"fredimatteo/migratron","owner":"fredimatteo","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-22T15:22:43.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T15:27:46.381Z","etag":null,"topics":["migration","postgresql","python3","sql"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fredimatteo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-03-19T15:17:27.000Z","updated_at":"2025-03-22T15:27:15.000Z","dependencies_parsed_at":"2025-03-22T15:38:43.799Z","dependency_job_id":null,"html_url":"https://github.com/fredimatteo/migratron","commit_stats":null,"previous_names":["fredimatteo/migratron"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredimatteo%2Fmigratron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredimatteo%2Fmigratron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredimatteo%2Fmigratron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredimatteo%2Fmigratron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fredimatteo","download_url":"https://codeload.github.com/fredimatteo/migratron/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245052947,"owners_count":20553232,"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":["migration","postgresql","python3","sql"],"created_at":"2025-03-23T04:18:25.534Z","updated_at":"2025-03-23T04:18:26.133Z","avatar_url":"https://github.com/fredimatteo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛠️ Migropy\n\n**Migropy** is a lightweight and extensible Python library for managing **database migrations**.  \nDesigned for simplicity and flexibility, it helps teams apply, track, and version-control schema changes across multiple\nenvironments.\n\n---\n\n## 🚀 Features\n\n- ✅ Versioned migrations with up/down support\n- ✅ Compatible with PostgreSQL\n- ✅ CLI for common migration operations\n- ✅ Safe and idempotent execution\n- ✅ Customizable migration directory structure\n\n---\n\n## 📦 Installation\n\n```bash\npip install migropy\n```\n\n---\n\n## 📖 How to use\n\n### 1. Initialize a new migration project\n\n```bash\nmigropy init\n```\n\n### 2. Go to the migrations directory\n\n```bash\ncd migrations\n```\n\n### 3. Fill the config.ini file\n\n```ini\n[database]\nhost = localhost\nport = 5432\nuser = postgres\npassword = postgres\ndbname = my_database\ntype = postgres\n\n[logger]\nlevel = DEBUG\n```\n\n### 4. Create a new migration\n\n```bash\nmigropy generate 'migration name'\n```\n\n### 5. Apply the migrations\n\n```bash\nmigropy apply\n```\n\n---\n\n## 📄 Migration example\n\n```sql\n-- Up migration\nCREATE TABLE users\n(\n    id    SERIAL PRIMARY KEY,\n    name  VARCHAR(100) NOT NULL,\n    email VARCHAR(100) NOT NULL\n);\n\n-- Down migration\nDROP TABLE users;\n```\n\n---\n\n## ⚙️ Available commands\n\n| Comando                   | Descrizione                   |\n|---------------------------|-------------------------------|\n| `migropy init`            | Init migratron environment    |\n| `migropy generate \u003cname\u003e` | Generate a new sql migration  |\n| `migropy upgrade`         | Apply all the migration       |\n| `migropy downgrade`       | Rollback all revisions        |\n| `migropy list `           | Show current migration status |\n\n---\n\n## 📄 License\n\nMIT License © 2025 — teoxy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredimatteo%2Fmigratron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffredimatteo%2Fmigratron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredimatteo%2Fmigratron/lists"}