mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 13:31:44 +08:00
annotate models
This commit is contained in:
parent
46f3261025
commit
2db3cfb16b
|
@ -20,3 +20,20 @@ class ApiKey < ActiveRecord::Base
|
|||
end
|
||||
|
||||
end
|
||||
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: api_keys
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# key :string(64) not null
|
||||
# user_id :integer
|
||||
# created_by_id :integer
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_api_keys_on_key (key)
|
||||
# index_api_keys_on_user_id (user_id) UNIQUE
|
||||
#
|
||||
|
|
|
@ -293,27 +293,31 @@ end
|
|||
#
|
||||
# Table name: categories
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# name :string(50) not null
|
||||
# color :string(6) default("AB9364"), not null
|
||||
# topic_id :integer
|
||||
# topic_count :integer default(0), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# user_id :integer not null
|
||||
# topics_year :integer
|
||||
# topics_month :integer
|
||||
# topics_week :integer
|
||||
# slug :string(255) not null
|
||||
# description :text
|
||||
# text_color :string(6) default("FFFFFF"), not null
|
||||
# hotness :float default(5.0), not null
|
||||
# read_restricted :boolean default(FALSE), not null
|
||||
# auto_close_days :float
|
||||
# id :integer not null, primary key
|
||||
# name :string(50) not null
|
||||
# color :string(6) default("AB9364"), not null
|
||||
# topic_id :integer
|
||||
# topic_count :integer default(0), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# user_id :integer not null
|
||||
# topics_year :integer
|
||||
# topics_month :integer
|
||||
# topics_week :integer
|
||||
# slug :string(255) not null
|
||||
# description :text
|
||||
# text_color :string(6) default("FFFFFF"), not null
|
||||
# hotness :float default(5.0), not null
|
||||
# read_restricted :boolean default(FALSE), not null
|
||||
# auto_close_days :float
|
||||
# post_count :integer default(0), not null
|
||||
# latest_post_id :integer
|
||||
# latest_topic_id :integer
|
||||
# position :integer not null
|
||||
# parent_category_id :integer
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_categories_on_forum_thread_count (topic_count)
|
||||
# index_categories_on_name (name) UNIQUE
|
||||
#
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ end
|
|||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# user_id :integer
|
||||
# ip_address :string
|
||||
# ip_address :inet
|
||||
# current_user_id :integer
|
||||
#
|
||||
# Indexes
|
||||
|
@ -111,4 +111,3 @@ end
|
|||
# index_incoming_links_on_created_at_and_domain (created_at,domain)
|
||||
# index_incoming_links_on_created_at_and_user_id (created_at,user_id)
|
||||
#
|
||||
|
||||
|
|
|
@ -455,6 +455,7 @@ end
|
|||
# notify_user_count :integer default(0), not null
|
||||
# like_score :integer default(0), not null
|
||||
# deleted_by_id :integer
|
||||
# edit_reason :string(255)
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
|
@ -462,4 +463,3 @@ end
|
|||
# index_posts_on_reply_to_post_number (reply_to_post_number)
|
||||
# index_posts_on_topic_id_and_post_number (topic_id,post_number) UNIQUE
|
||||
#
|
||||
|
||||
|
|
|
@ -4,3 +4,20 @@ class PostDetail < ActiveRecord::Base
|
|||
validates_presence_of :key, :value
|
||||
validates_uniqueness_of :key, scope: :post_id
|
||||
end
|
||||
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: post_details
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# post_id :integer
|
||||
# key :string(255)
|
||||
# value :string(255)
|
||||
# extra :text
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_post_details_on_post_id_and_key (post_id,key) UNIQUE
|
||||
#
|
||||
|
|
|
@ -35,11 +35,10 @@ end
|
|||
# last_match_at :datetime
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# ip_address :string
|
||||
# ip_address :inet
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_blocked_emails_on_email (email) UNIQUE
|
||||
# index_blocked_emails_on_last_match_at (last_match_at)
|
||||
#
|
||||
|
||||
|
|
|
@ -50,3 +50,21 @@ class ScreenedIpAddress < ActiveRecord::Base
|
|||
!!b and b.action_type == action_type
|
||||
end
|
||||
end
|
||||
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: screened_ip_addresses
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# ip_address :inet not null
|
||||
# action_type :integer not null
|
||||
# match_count :integer default(0), not null
|
||||
# last_match_at :datetime
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_screened_ip_addresses_on_ip_address (ip_address) UNIQUE
|
||||
# index_screened_ip_addresses_on_last_match_at (last_match_at)
|
||||
#
|
||||
|
|
|
@ -49,11 +49,10 @@ end
|
|||
# last_match_at :datetime
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# ip_address :string
|
||||
# ip_address :inet
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_screened_urls_on_last_match_at (last_match_at)
|
||||
# index_screened_urls_on_url (url) UNIQUE
|
||||
#
|
||||
|
||||
|
|
|
@ -729,6 +729,7 @@ end
|
|||
# auto_close_user_id :integer
|
||||
# auto_close_started_at :datetime
|
||||
# deleted_by_id :integer
|
||||
# participant_count :integer default(1)
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
|
@ -737,4 +738,3 @@ end
|
|||
# index_topics_on_deleted_at_and_visible_and_archetype_and_id (deleted_at,visible,archetype,id)
|
||||
# index_topics_on_id_and_deleted_at (id,deleted_at)
|
||||
#
|
||||
|
||||
|
|
|
@ -53,10 +53,9 @@ end
|
|||
# user_id :integer
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# ip_address :string not null
|
||||
# ip_address :inet not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_forum_thread_link_clicks_on_forum_thread_link_id (topic_link_id)
|
||||
#
|
||||
|
||||
|
|
|
@ -111,6 +111,7 @@ end
|
|||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# sha1 :string(40)
|
||||
# origin :string(1000)
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
|
@ -119,4 +120,3 @@ end
|
|||
# index_uploads_on_url (url)
|
||||
# index_uploads_on_user_id (user_id)
|
||||
#
|
||||
|
||||
|
|
|
@ -635,7 +635,7 @@ end
|
|||
# auto_track_topics_after_msecs :integer
|
||||
# views :integer default(0), not null
|
||||
# flag_level :integer default(0), not null
|
||||
# ip_address :string
|
||||
# ip_address :inet
|
||||
# new_topic_duration_minutes :integer
|
||||
# external_links_in_new_tab :boolean default(FALSE), not null
|
||||
# enable_quoting :boolean default(TRUE), not null
|
||||
|
@ -656,4 +656,3 @@ end
|
|||
# index_users_on_username (username) UNIQUE
|
||||
# index_users_on_username_lower (username_lower) UNIQUE
|
||||
#
|
||||
|
||||
|
|
|
@ -42,11 +42,10 @@ end
|
|||
# parent_type :string(50) not null
|
||||
# viewed_at :date not null
|
||||
# user_id :integer
|
||||
# ip_address :string not null
|
||||
# ip_address :inet not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_views_on_parent_id_and_parent_type (parent_id,parent_type)
|
||||
# index_views_on_user_id_and_parent_type_and_parent_id (user_id,parent_type,parent_id)
|
||||
#
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user