Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/altipla-consulting/reset-db-mysql
Reset a MySQL database to an empty state recreating it if needed.
https://github.com/altipla-consulting/reset-db-mysql
mysql nodejs
Last synced: about 1 month ago
JSON representation
Reset a MySQL database to an empty state recreating it if needed.
- Host: GitHub
- URL: https://github.com/altipla-consulting/reset-db-mysql
- Owner: altipla-consulting
- License: mit
- Created: 2023-12-08T19:28:10.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-06T16:24:06.000Z (8 months ago)
- Last Synced: 2024-08-10T07:34:42.981Z (5 months ago)
- Topics: mysql, nodejs
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/reset-db-mysql
- Size: 33.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# reset-db-mysql
Reset a MySQL database to an empty state recreating it if needed.
## Install
```shell
npm i -D reset-db-mysql
```## Usage
Configure the reset command in your `package.json` file:
```js
{
"scripts": {
"db:reset": "reset-db-mysql"
}
}
```Configure the `DATABASE_URL` in your local `.env` variables:
```ini
DATABASE_URL="mysql://USER:PASSWORD@HOST:3306/DATABASE"
```And run the command every time you want to reset and remove all the tables of the database:
```shell
npm run db:reset
```