Migrations are not detected by the application. The application understands models. The models will have relationships defined. When we use Sequel, we get a lot of methods to access our data store as objects. Let's now define our models.
The user model will have the following properties:
The file will be
1 require 'sequel' 2 3 class User < Sequel::Model 4 set_primary_key :id 5 6 one_to_many :items 7 one_to_many :permissions 8 one_to_many :logs 9 end
Let's understand each line one by one:
class User < Sequel::Modeltells the application to inherit the
Modelclass of the