I have two tables
1. Rectangle (rectId, xPos, yPos, height, width)
2. Scale (scaleId, someothercols ...)
Now each column of the rectangle can be mapped to a scale from 0 to 1.
ie xPos can scale, yPos can scale, etc. Thus, in the general case, one rectangle can have more than one scale.
Also, all of the above columns may also not have a reference to scale, in which case they will have a static value ie xPos = 50, yPos = 60, and so on.
You can also reference a scale to more than one rectangle.
What is the best way to implement this in sql
What I thought has a Rectangle_scale join table with rect_column exg attribute:
Rectangle_scale
| rectScaleId | rectId | scaleId | rect_col(string)|
|:----------- |------------:|:------------:|---------------- |
| 1 | 1 | 2 | Xpos |
| 2 | 1 | 3 | Ypos |
| 3 | 2 | 2 | Height |
? rectScaleId, rectId scaleId
, - , , Laravel 5.2 , , , Laravel eloquent, .