18 lines
390 B
Crystal
18 lines
390 B
Crystal
class Post < BaseModel
|
|
table do
|
|
column file_url : String
|
|
column title : String?
|
|
column description : String?
|
|
timestamps
|
|
column score : Int64
|
|
column views : Int64
|
|
column favourites : Int64
|
|
column file_size : Int64
|
|
|
|
belongs_to creator : User?
|
|
|
|
has_many post_tags : PostTag
|
|
has_many tags : Tag, through: :post_tags
|
|
end
|
|
end
|