aerogear / datasync-starter

GraphQL Low Code React and Node.js DataSync Application template
http://graphback.dev
MIT License
32 stars 38 forks source link

add backup.ts, restore.ts files to dump and restore mongodb #413

Open machi1990 opened 4 years ago

machi1990 commented 4 years ago

Feature Request

Current, OVP https://github.com/aerogear/OpenVolunteerPlatform/blob/master/platform/server/src/db.ts is doing multiple functionalities of backing up the db and restoring it by default.

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Maybe we can split this into two parts:

The first two files can lead to scripts in package.json

{
  "scripts": {
     .....
    "backup": "ts-node server/backup.ts",
    "restore": "ts-node server/restore.ts"
     }
}

Describe alternatives you've considered Right now If we want to do backup, we just have to uncomment the backup part in db.ts, without forgetting to comment it back to avoid backing up the data each time.

wtrocki commented 4 years ago

@machi1990 that will be perfect issue for DataSync starter

machi1990 commented 4 years ago

Makes sense, let me transfer the issue there?

wtrocki commented 4 years ago

Actually this is only valid for this app as we have initial data.

wtrocki commented 4 years ago

Changed my mind. Data dump restore feature could be improved

machi1990 commented 4 years ago

Yes, we have it only for the OVP app but seems to me like a typical use case so having dumping and restore features at least as commands could do it.