Build a planning avalabilities

I want to build a planning availabilities per users.
I already have an idea but I don't know if it is the easiest one to
I already have a user model.
I could create a unavailabilites table with these columns:
id, from, to, user_id

And I have a calendar view where i check for each hours of the day the
unavailabilities. And then I am able to build the unavailabilities

What do you think?