https://github.com/enzodeg40/db-commit
Quickly managed database tables to include in your commits
https://github.com/enzodeg40/db-commit
database mysql nodejs
Last synced: about 1 year ago
JSON representation
Quickly managed database tables to include in your commits
- Host: GitHub
- URL: https://github.com/enzodeg40/db-commit
- Owner: EnzoDeg40
- Created: 2022-12-13T09:22:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-31T14:19:46.000Z (over 3 years ago)
- Last Synced: 2025-05-08T01:15:22.356Z (about 1 year ago)
- Topics: database, mysql, nodejs
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/db-commit
- Size: 14.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# db-commit [WIP]
This package allows you to manage database migrations in NodeJS projects using SQL type migration files (like [doctrine](https://www.doctrine-project.org/) for example). It uses the package [mysql](https://www.npmjs.com/package/mysql) to connect to the database.
## Installation
```bash
npm install -g db-commit
npm link db-commit
```
Create a .env file in the root of your project with the following content. `DB_PORT` is optional.
```bash
DB_HOST="localhost"
DB_USER="root"
DB_PASSWORD="password"
DB_NAME="my_database"
DB_PORT="3306"
```
## Usage
Generate SQL files in `database` folder
```bash
db-commit pull
```
Apply SQL files in `database` folder
```bash
db-commit push
```
Remove SQL files in `database` folder
```bash
db-commit remove
```