feat: create clicks model + migration

This commit is contained in:
Juan Rodriguez
2024-07-12 07:27:36 +02:00
parent ff06e10b8f
commit 2f796dbdab
4 changed files with 37 additions and 2 deletions
+18
View File
@@ -0,0 +1,18 @@
require "crecto"
module App::Models
class Click < Crecto::Model
schema :clicks do
field :id, String, primary_key: true
field :user_agent, String
field :language, String
field :browser, String
field :os, String
field :source, String
belongs_to :link, Link
end
validate_required [:user_agent, :language, :source]
end
end
-1
View File
@@ -9,7 +9,6 @@ module App::Models
field :id, String, primary_key: true
field :slug, String
field :url, String
field :click_counter, Int64, default: 0
belongs_to :user, User
end