parent
7c94fa0587
commit
fbf67891ed
@ -0,0 +1,30 @@
|
||||
require_relative "db"
|
||||
|
||||
class Entity < Sequel::Model
|
||||
one_to_many :notes
|
||||
one_to_many :sources
|
||||
one_to_one :title
|
||||
many_to_many :tags
|
||||
one_to_one :url
|
||||
end
|
||||
|
||||
class Note < Sequel::Model
|
||||
many_to_one :entity
|
||||
end
|
||||
|
||||
class Source < Sequel::Model
|
||||
many_to_one :entity
|
||||
many_to_one :source, class: :Entity
|
||||
end
|
||||
|
||||
class Title < Sequel::Model
|
||||
many_to_one :entity
|
||||
end
|
||||
|
||||
class Tag < Sequel::Model
|
||||
many_to_many :entities
|
||||
end
|
||||
|
||||
class Url < Sequel::Model
|
||||
one_to_one :entity
|
||||
end
|
Loading…
Reference in new issue