I have read from multiple sources (like this pdf) that in a linear regression model, an ordinal variable can be obtained by imposing linear restrictions on its dummy coding.
e.g. $x$ is an ordinal variable ranging from
1 to 5, so
$$y_1= b_0+ b_1x+e$$
is just a nested model of $$y_2=b_0+b_1(x=2)+b_2(x=3)+b_3(x=4)+b_4(x=5)+e$$
Which linear restrictions should be imposed on $y_2$ in order to obtain $y_1$?