-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat user backup #64
base: dev
Are you sure you want to change the base?
Feat user backup #64
Conversation
Someone is attempting to deploy a commit to a Personal Account owned by @RizkyRajitha on Vercel. @RizkyRajitha first needs to authorize it. |
Codecov Report
@@ Coverage Diff @@
## dev #64 +/- ##
==========================================
- Coverage 76.71% 74.69% -2.02%
==========================================
Files 3 3
Lines 146 166 +20
Branches 29 30 +1
==========================================
+ Hits 112 124 +12
- Misses 27 35 +8
Partials 7 7
Continue to review full report at Codecov.
|
lib/dbfuncprisma.js
Outdated
|
||
// delete old data | ||
await Promise.all([ | ||
Prisma.linkdata.deleteMany(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await Prisma.$executeRaw("ALTER SEQUENCE linkdata_id_seq RESTART WITH 1;");
i thinks it's better to reset the id sequence also because we are backing up with id
better to do this with social icons also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes!, I had not taken it into account
fixed in 52e36cb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good work @dubisdev ,
lets keep this as a draft until we test it enough and then release with next version
thanks.
} from "../../../lib/dbfuncprisma"; | ||
|
||
// endoint for download and restore backups | ||
async function handler(req, res) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await use(req, res, jwtAuth);
use middleware here to avoid duplicates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 7586d13
Contributing Guidelines pull request Making a pull request
Guidelines
This pull request regarding on
Briefly describe what you did
Created a form for getting a backup and restore from files.
![image](https://user-images.githubusercontent.com/77246331/144749003-bb8f14c3-7181-4474-b1fe-56fefb4bfcc5.png)
If the file is not a valid backup, returns error and no data is lost.
![image](https://user-images.githubusercontent.com/77246331/144749124-78fbd8b9-8030-49c5-a6cf-5a38f085b27a.png)
I also included the linkin version in the backup for future compatibility checks (if breaking changes are included).
Appreciate your contribution to making Linkin better 🚀.