I am trying to define the models based on the following diagram
My problem occurs when trying to generate a migration for the "Teacher" type, how can I add a custom field (like salary) to each of my user types if I can't create a migration because they are not a table as such.
I already have a model created with Devise for User, but I cannot find documentation or related examples for this type of case with custom fields for User types.

STI stands for single table inheritence. This means when you want to add a column to one of the subtypes then you need to add that column to the superclasses table.
In your example, when you want a
Teacher#salaryattribute then you need to add thatsalarycolumn to theuserstable.This means you will need a have a migration like this:
You might want to read about STI in the Rails API docs and follow the link to Martin Fowler: Single Table Inheritance.