In this video, we build a complete Resume Upload system for a real Job Portal application using Next.js, MySQL, Drizzle ORM, and Zod validation.
You’ll learn why creating a separate resume table is the correct database design instead of just adding a resumeUrl field inside the applicant table.
We’ll cover:
• Designing a Resume schema using Drizzle ORM • Creating proper relationships between Applicant and Resume • Understanding why one table is not enough • Migrating schema safely • Storing resume URL from UploadThing • Adding Zod validation for resume URL and resume name • Real production-level architecture decisions
If you're building a real job portal or any scalable SaaS application, this video will help you design your database the right way.
This is not just file upload — this is proper backend architecture. ------------------------------------------------------------------------------------ 🔗 Useful Playlists
⌛TIMELINE⏳ 0:00 Resume Upload Schema & Project Overview 0:30 How Resume Upload Works in Real Job Portals 3:25 Support the Channel ❤️ 3:50 Creating Resume Schema with Drizzle ORM 5:50 How Resume is Stored & URL Handling (Real Case) 7:50 Completing Resume Schema Design 9:04 Defining Resume ↔ Applicant Relationship 11:25 Generating & Migrating the Schema 11:50 Zod Validation for Resume URL & Name 13:40 Recommended PDF Upload & Backend Videos
AI Generated·May contain errors
Hello what's up guys
Welcome to the NextGest and MySQL page in the job portal application
Today is day 80
Today we're going to explore
Resume Schema and Job Validation
This video is extremely important
Because you've all been waiting for this
Here's how to upload your resume
You can see we've already set it up
Uploading your resume is simple
But we can't do it directly
There are a few steps involved
We must follow this path that's
why we need
to understand clearly
what steps should we take are
you grasping it think carefully
This is our profile form
Essentially for the applicant
We've already learned how to upload an image
Then we've seen how to add a paragraph
And we've covered
Which field
It belongs to
Which table it belongs to
If we're discussing our resume section
This is my resume
What do you think
Why don't I select an applicant
Like the one we already have
And in that applicant
I'll add a field
Do you want to
If it happens
like this
Previously you had a
front-end role for a front
-end position you uploaded your resume here
and we're considering that once it's uploaded
when this same applicant
goes to apply for a job
I will apply for the job which will then appear in the dropdown
and be selected if I add a
field to the applicant's table
Then what will happen
There could be an issue
If tomorrow I have to upload a resume for a backend role then what
will happen is I'll have
to upload a new one
This will happen because
My first frontend will be updated
This is incorrect
Are you following
What I'm trying to convey
It's possible that in January
You uploaded a frontend file
Essentially you applied for a positio
And you uploaded a front-end
resume then in February you applied
for a back-end position and
updated your
resume accordingly
So now in
February your current
resume is
for back end and now in March HR
checked your front end
resume reviewed
it and shortlisted it now when
HR checks
your resume again
He won't see your front-end resume he'll see
your back-end resume He 'll
feel that in a front
-end role there are back
-end languages involved
Do you understand what I'm trying to say
If you keep updating
your default resume
will be updated which
is why we
need to create
a new resume table so
you can
upload as many
resumes as you want
without any conflicts
I hope you understand
that we need to
create a new table and since we're using Drizzle that's
why I mentioned we must
set up a new schema for
the resume—so how should
we go about doing that
And we also need to perform job
validation so both of them will be
covered in this video where you' ll learn a lot—so
let's get started
Before that if you haven't watched the previous
video our next goal is
800 000 subscribers—if you
haven't subscribed yet
please do so it would mean
a great deal to me and if you'd like to join us
You must join—it's
just 1 499 rupees join
now and you'll enjoy
it so
let's get started
—I've already done it
typing and explaining
are the same saving
you time so take a look
Right now I'm working on the schema ts file
which is inside our Drizzle directory
So inside the drizzle folder
you'll see
we've created a new schema for the resume
If you look
normally in Drizzle
If you want to create a new
scheme This is your syntax
We are using MySQL language
So the MySQL table is your table name
Let me show you
Resume And some
Applicant ID
File URL
You can see
These are our field names
Which we are going to create I know it's not created yet
But it will be
So in the resume table
The main thing for us is establishing
a connection between the applicant
and their resume—specifically which
applicant corresponds to which resume In
a way I need a clear link between the
two That’s right And
for that we start
with your ID followed by the applicant
ID—this is the most crucial part
Because you'll be uploading your
resume — just like the resume
will be uploaded — but who is
doing the uploading How will you
know who's uploading the resume
Even though we know it's the
applicant not the employer there
will still be many applicants
So among all those
applicants which one is it How
will we know With the help
of the applicant ID Now this
applicant ID can't be written
directly—we have to provide
a reference and that comes
from our applicant table
You can see that
we will generate an applicant
ID which is an
integer save it in the
resume provide a reference and
retrieve the
reference from our
applicant table's ID field
So this is our reference —
the applicant table ID Now we
are matching it essentially
we'll retrieve
it when we store
it And the second important
property is on delete cascade —
meaning for example if the
applicant deletes their account
So when there'
s no applicant
what should we do with
his resume That resume
from this applicant will be
automatically deleted along
with all other resumes
uploaded to the profile Okay
so from this I'm learning
There must be an applicant
ID in the resume table so
we can identify which
applicant this resume belongs
to the file URL is essentially the resume URL so
there's no need to specify
it as we did with images
Here too whatever
you do will
appear here — you
can see if
I upload anything it
will be added right
here you can see on
testpdia I just added
it and you can see
So basically it will
come here give us
a URL and we'll
need to retrieve that
URL and store it in our database Now
I'll show you how
it looks—don't worry
Here's the URL —
Uploaded resume
URL — I've
just uploaded it so
Whether it's an image
or a file don't store
it on our server—save
it on another server
like the one we're
already using Upload the file get a URL and
then add that link here
So that our storage remains
secure and easy to use
I'll show
you normally
—by the way it's a PDF
only I'll let you
know so the
file's URL—
basically your resume
URL No need
to say this
URL we'll save it here
Now the file's name
By default the best part is that in tomorrow's
video I'll tell you the
file's name and URL its size
automatically and the upload
process will give you a
response so don't worry—I'll
get the file's name right here
File size must not
exceed 5 MB maximum is
4 MB This is the
primary
consideration I
assumed users might
upload 4 to 5 resumes
so the primary limit
is set accordingly
I'm using it I thought of
it now it's
false we'll see
Let's keep a primary
one then create
and update it—
no need to
state when it was
created now it's a resume
Now we have to
define it in our address
We did:
two relationships—first the
resume with the applicant
If you
see Resume
TableApplicant
Question is
How many applicants
Resume belongs to If we think
Question is wrong
Resume
Belongs to one applicant
I have a resume
This is my mobile
Resume
Belongs to me
One applicant
The resume belongs to one applicant
When defining a one-to-
one relationship you must
specify the field and
reference resume callback
function one belongs to
one applicant When defining
one-to-one you must define
the field and reference
Field means
In your resume table
Which field you
want to connect
Which foreign key
In my resume
Applicant ID is
the foreign key
I am referencing it
With which table
Applicants ID table
This is how you write in IRA
We need to define one more relationship
That's not correct
Can one applicant
Have only one resume
No
One applicant can have multiple resumes
When you define one-to-many
Then we don't need fields and
references—so simple applicants
can have multiple resumes so
simple when you
create the schema
Wipe the screen
npm run db
We need to generate
Once generated it will be yours
That dog and the cat are good companions
First you need to generate this scheme
And you must follow him otherwise
That will be the one going to your database regarding that matter
And if you open Drizzle and refresh it
So regarding your resume table of this kind
Here you'll see it — the simplicity is so overwhelming
And this case isn't showing up for anyone
Once it happens why would you even bother doing it
It will appear for our Jordan
Jordan Scheme also needs to be shown
So earlier we had placed some of these in this manner
It's simple—there's nothing more to think about here
So now we've placed the resume URL in Apstinal
And this is a URL here just like in the Jordan version 4 you'll find it too
If Inkes encounters any error an invalid URL will be returned we've kept this in place
I've told you this extra line many times before
Whenever you exit the AMT in the React Hook form it returns an AMT string to you
Now that you're writing an apostle what does Jordan see
So Jordan is asking okay listen the applicant isn't uploading the resume to the portal
Is there an undefined value in place of that field
The resume's name is not a file and it is not a file
So these two fields we need to handle now what changes do we need to make on our UI
I'll tell you about that in tomorrow's video but first there's something else
So I'd like to inform you that we've already reviewed the image upload earlier
And the video we'll watch tomorrow is actually the same one we already saw earlier
We'll need to make some changes—previously it was an image but now we must validate the files related to the Pediap
She highly recommends that you be fully prepared for tomorrow
Please definitely check out the video to understand exactly what’s going on and how it’s happening—this is the third video
Please make sure to check this out
You'll get a lot of help
at here the same way we have with PDFs
That's what we need to do just as before with the image
We were checking it earlier now we need to check it as a PDF
which is uploaded by default for you
Provides it okay so or this video
Keep it so the proper
time will
surely be kept
I'd be delighted if you
liked it please like it
Didn't like it Dislike
Dislike is something you absolutely have to deal with
Pleased and speaking softly
Definitely going to do it