{"id":13481448,"url":"https://github.com/pravasan/pravasan","last_synced_at":"2026-03-15T04:42:01.983Z","repository":{"id":25322586,"uuid":"28749541","full_name":"pravasan/pravasan","owner":"pravasan","description":"Simple Migration Tool - written in Go","archived":false,"fork":false,"pushed_at":"2018-12-20T01:56:10.000Z","size":57183,"stargazers_count":29,"open_issues_count":30,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-30T15:50:47.352Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://pravasan.github.io/pravasan/","language":"HTML","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/pravasan.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":"2015-01-03T17:11:05.000Z","updated_at":"2024-06-20T01:43:48.000Z","dependencies_parsed_at":"2022-08-26T16:21:47.988Z","dependency_job_id":null,"html_url":"https://github.com/pravasan/pravasan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pravasan%2Fpravasan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pravasan%2Fpravasan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pravasan%2Fpravasan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pravasan%2Fpravasan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pravasan","download_url":"https://codeload.github.com/pravasan/pravasan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245844830,"owners_count":20681786,"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":[],"created_at":"2024-07-31T17:00:51.914Z","updated_at":"2025-12-23T00:02:40.892Z","avatar_url":"https://github.com/pravasan.png","language":"HTML","funding_links":[],"categories":["Database","\u003cspan id=\"数据库-database\"\u003e数据库 Database\u003c/span\u003e","数据库  `go语言实现的数据库`","数据库","數據庫","Generators","Uncategorized"],"sub_categories":["Advanced Console UIs","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","Database Schema Migration","高级控制台界面","数据库模式迁移","高級控制台界面","标准 CLI"],"readme":"# Pravasan\nSimple Migration tool intend to be used for any languages, for any db.\n\n[![Build Status](https://travis-ci.org/pravasan/pravasan.svg?branch=master)](https://travis-ci.org/pravasan/pravasan)\n\n*Please feel free to criticize, comment, etc.*\n*Currently this is working for MySQL, PostgreSQL.* Soon will be available for other Databases too.\n\n## Definition in Hindi\n----\nप्रवसन {pravasan} = MIGRATION(Noun)\n\n* [Install](#install)\n* [Usage](#usage)\n* [High Level Features](#high-level-features)\n* [All Features / Bugs](#all-features--bugs)\n* [Details](#details)\n\n## Install\n\n1. Choose proper OS \u0026 Download from http://pravasan.github.io/pravasan/#download\n2. Unzip / Untar the file downloaded \n3. For some OS its default but some it needs to be explicit add \n```chmod +x pravasan_*```\n4. Look at the below Usage and start using it from the folder where you would like to execute \u0026 store migration files.\n\n## Usage\n\n### Syntax\n```pravasan [\u003cflags\u003e] \u003caction\u003e \u003csub-action\u003e [data input]```\n\n### Flags\n```\nUsage of pravasan:\n  -autoAddColumns=\"\": Add default columns when table is created\n  -confOutput=\"json\": config file format: json, xml\n  -d=\"\": database name\n  -dbType=\"mysql\": database type\n  -h=\"localhost\": database hostname\n  -indexPrefix=\"idx\": prefix for creating Indexes\n  -indexSuffix=\"\": suffix for creating Indexes\n  -migDir=\"./\": migration file stored directory\n  -migFileExtn=\"prvsn\": migration file extension\n  -migFilePrefix=\"\": prefix for migration file\n  -migOutput=\"json\": current supported format: json, xml\n  -migTableName=\"schema_migrations\": migration table name\n  -p=false: database password\n  -port=\"5432\": database port\n  -storeDirectSQL=true: Store SQL in migration file instead of XML / JSON\n  -u=\"\": database username\n  -version=false: print Pravasan version\n```\n\nTo create the configuration file use either of the below commands \u0026 pravasan.conf.json / pravasan.conf.xml will be created\n```\npravasan -u=\"root\" -p -dbType=\"mysql\" -d=\"testdb\" -h=\"localhost\" -port=\"5433\" create conf \npravasan -u=root -p -dbType=postgres -d=testdb -h=localhost -port=5433 -output=xml create conf \n```\n\nAssuming the pravasan.conf.json or pravasan.conf.xml file is set already\n```\npravasan add add_column test123 id:int\npravasan a ac test123 id:int                                     # Same as above\n\npravasan add add_index test123 id order name\n\npravasan add create_table test123 id:int name:string order:int status:bool\npravasan a ct test123 id:int name:string order:int status:bool              # Same as above\n\npravasan add drop_column test123 id\npravasan add drop_index test123 id order name\npravasan add rename_table test123 new_test123\npravasan add sql                                           # to add SQL statements directly.\n\npravasan down [-1]\npravasan up\npravasan up 20150103174227, 20150103174333\n```\n\nIf you like not to store the credentials in file then use it like this\n```\npravasan -u=root -p -dbType=postgres -d=testdb -h=localhost -port=5433 up 20150103174227\n```\n\n## Work in progress are:\n- [ ] Support for Oracle, MongoDB, etc.,\n\n## High Level Features\n- [x] Create \u0026 read from Conf file (XML / JSON)\n- [x] Output in XML, JSON format\n- [x] Support for Direct SQL Statements \n- [x] Support for MySQL, Postgres\n- Temporarily SQLite3 is stopped - due to compile issue.\n\n## All Features / Bugs\n- [x] [v0.1](https://github.com/pravasan/pravasan/milestones/v0.1)\n- [x] [v0.2](https://github.com/pravasan/pravasan/milestones/v0.2)\n- [x] [v0.3](https://github.com/pravasan/pravasan/milestones/v0.3)\n- [ ] [v0.4](https://github.com/pravasan/pravasan/milestones/v0.4)\n- [ ] [v1.0](https://github.com/pravasan/pravasan/milestones/v1.0)\n- [ ] [v2.0](https://github.com/pravasan/pravasan/milestones/v2.0)\n\n#### Few Other Notes: \n* moved from https://github.com/kishorevaishnav/godbmig\n\n## Details\n\n### Add few columns by default during creation of a table.\n```\n$ pravasan -autoAddColumns: id:int created_at:datetime modified_at:datetime create conf\n```\nThe above command will add the 3 columns ```id```, ```created_at```, ```modified_at``` will be stored in configuration \u0026 will get added during any ```create_table``` statements.\n\n### To store direct sql in JSON or XML format\n```\n$ pravasan -storeDirectSQL a ct test123 id:int\n```\nThe above command will add (```a```) a migration \u0026 will generate create_table (```ct```) action with the table name ```test123``` with only one column ```id``` of datatype ```int``` as SQL into the JSON (by default) or XML if there is an configuration file present and set XML to generate.\n\n### To get the list of datatypes supported\n\n```\n$ pravasan list datatypes           # All databases\n$ pravasan l dt                     # All databases\n$ pravasan list dt postgresql       # Will list datatypes supported by PostgreSQL\n$ pravasan list datatypes sqlite3   # Will list datatypes supported by SQLite3\n$ pravasan l dt mysql               # Will list datatypes supported by MySQL\n```\nBelow is the sample output for the above last command.\n```\n+-------------------+-----------------------+--------------+\n|     DATATYPE      | SUPPORTED DATABASE(S) |    ALIAS     |\n+-------------------+-----------------------+--------------+\n| VARCHAR           | MySQL                 |              |\n| VARBINARY         | MySQL                 |              |\n| MEDIUMBLOB        | MySQL                 |              |\n| LONGBLOB          | MySQL                 |              |\n| DATE              | MySQL                 |              |\n| REAL              | MySQL                 |              |\n| DEC               | MySQL                 | DECIMAL      |\n| NUMERIC           | MySQL                 | DECIMAL      |\n| STRING            | MySQL                 | VARCHAR(255) |\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpravasan%2Fpravasan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpravasan%2Fpravasan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpravasan%2Fpravasan/lists"}