add allowed_ips to api_keys

update annotations
This commit is contained in:
Sam 2014-11-20 14:53:15 +11:00
parent 98e8523eec
commit 6bed4e1bf0
17 changed files with 147 additions and 93 deletions

View File

@ -31,6 +31,7 @@ end
# created_by_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# allowed_ips :inet is an Array
#
# Indexes
#

View File

@ -303,6 +303,7 @@ end
# trigger :integer
# show_posts :boolean default(FALSE), not null
# system :boolean default(FALSE), not null
# image :string(255)
#
# Indexes
#

View File

@ -393,38 +393,39 @@ 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 default(0)
# topics_month :integer default(0)
# topics_week :integer default(0)
# slug :string(255) not null
# description :text
# text_color :string(6) default("FFFFFF"), not null
# read_restricted :boolean default(FALSE), not null
# auto_close_hours :float
# post_count :integer default(0), not null
# latest_post_id :integer
# latest_topic_id :integer
# position :integer
# parent_category_id :integer
# posts_year :integer default(0)
# posts_month :integer default(0)
# posts_week :integer default(0)
# email_in :string(255)
# email_in_allow_strangers :boolean default(FALSE)
# topics_day :integer default(0)
# posts_day :integer default(0)
# logo_url :string(255)
# background_url :string(255)
# allow_badges :boolean default(TRUE), not null
# name_lower :string(50) not null
# 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 default(0)
# topics_month :integer default(0)
# topics_week :integer default(0)
# slug :string(255) not null
# description :text
# text_color :string(6) default("FFFFFF"), not null
# read_restricted :boolean default(FALSE), not null
# auto_close_hours :float
# post_count :integer default(0), not null
# latest_post_id :integer
# latest_topic_id :integer
# position :integer
# parent_category_id :integer
# posts_year :integer default(0)
# posts_month :integer default(0)
# posts_week :integer default(0)
# email_in :string(255)
# email_in_allow_strangers :boolean default(FALSE)
# topics_day :integer default(0)
# posts_day :integer default(0)
# logo_url :string(255)
# background_url :string(255)
# allow_badges :boolean default(TRUE), not null
# name_lower :string(50) not null
# auto_close_based_on_last_post :boolean default(FALSE)
#
# Indexes
#

View File

@ -580,13 +580,14 @@ end
# version :integer default(1), not null
# cook_method :integer default(1), not null
# wiki :boolean default(FALSE), not null
# via_email :boolean default(FALSE), not null
# raw_email :text
# baked_at :datetime
# baked_version :integer
# hidden_at :datetime
# self_edits :integer default(0), not null
# reply_quoted :boolean default(FALSE), not null
# via_email :boolean default(FALSE), not null
# raw_email :text
# public_version :integer default(1), not null
#
# Indexes
#

View File

@ -464,5 +464,6 @@ end
# Indexes
#
# idx_unique_actions (user_id,post_action_type_id,post_id,targets_topic) UNIQUE
# idx_unique_flags (user_id,post_id,targets_topic) UNIQUE
# index_post_actions_on_post_id (post_id)
#

View File

@ -47,6 +47,7 @@ end
# number :integer
# created_at :datetime not null
# updated_at :datetime not null
# hidden :boolean default(FALSE), not null
#
# Indexes
#

View File

@ -215,6 +215,8 @@ end
# mobile_stylesheet :text
# mobile_header :text
# mobile_stylesheet_baked :text
# footer :text
# mobile_footer :text
#
# Indexes
#

View File

@ -33,14 +33,14 @@ end
# == Schema Information
#
# Table name: site_text
# Table name: site_texts
#
# text_type :string(255) not null, primary key
# value :text not null
# created_at :datetime not null
# updated_at :datetime not null
# text_type :string(255) not null, primary key
# value :text not null
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_site_text_on_text_type (text_type) UNIQUE
# index_site_texts_on_text_type (text_type) UNIQUE
#

View File

@ -855,56 +855,58 @@ end
#
# Table name: topics
#
# id :integer not null, primary key
# title :string(255) not null
# last_posted_at :datetime
# created_at :datetime not null
# updated_at :datetime not null
# views :integer default(0), not null
# posts_count :integer default(0), not null
# user_id :integer
# last_post_user_id :integer not null
# reply_count :integer default(0), not null
# featured_user1_id :integer
# featured_user2_id :integer
# featured_user3_id :integer
# avg_time :integer
# deleted_at :datetime
# highest_post_number :integer default(0), not null
# image_url :string(255)
# off_topic_count :integer default(0), not null
# like_count :integer default(0), not null
# incoming_link_count :integer default(0), not null
# bookmark_count :integer default(0), not null
# star_count :integer default(0), not null
# category_id :integer
# visible :boolean default(TRUE), not null
# moderator_posts_count :integer default(0), not null
# closed :boolean default(FALSE), not null
# archived :boolean default(FALSE), not null
# bumped_at :datetime not null
# has_summary :boolean default(FALSE), not null
# vote_count :integer default(0), not null
# archetype :string(255) default("regular"), not null
# featured_user4_id :integer
# notify_moderators_count :integer default(0), not null
# spam_count :integer default(0), not null
# illegal_count :integer default(0), not null
# inappropriate_count :integer default(0), not null
# pinned_at :datetime
# score :float
# percent_rank :float default(1.0), not null
# notify_user_count :integer default(0), not null
# subtype :string(255)
# slug :string(255)
# auto_close_at :datetime
# auto_close_user_id :integer
# auto_close_started_at :datetime
# deleted_by_id :integer
# participant_count :integer default(1)
# word_count :integer
# excerpt :string(1000)
# pinned_globally :boolean default(FALSE), not null
# id :integer not null, primary key
# title :string(255) not null
# last_posted_at :datetime
# created_at :datetime not null
# updated_at :datetime not null
# views :integer default(0), not null
# posts_count :integer default(0), not null
# user_id :integer
# last_post_user_id :integer not null
# reply_count :integer default(0), not null
# featured_user1_id :integer
# featured_user2_id :integer
# featured_user3_id :integer
# avg_time :integer
# deleted_at :datetime
# highest_post_number :integer default(0), not null
# image_url :string(255)
# off_topic_count :integer default(0), not null
# like_count :integer default(0), not null
# incoming_link_count :integer default(0), not null
# bookmark_count :integer default(0), not null
# star_count :integer default(0), not null
# category_id :integer
# visible :boolean default(TRUE), not null
# moderator_posts_count :integer default(0), not null
# closed :boolean default(FALSE), not null
# archived :boolean default(FALSE), not null
# bumped_at :datetime not null
# has_summary :boolean default(FALSE), not null
# vote_count :integer default(0), not null
# archetype :string(255) default("regular"), not null
# featured_user4_id :integer
# notify_moderators_count :integer default(0), not null
# spam_count :integer default(0), not null
# illegal_count :integer default(0), not null
# inappropriate_count :integer default(0), not null
# pinned_at :datetime
# score :float
# percent_rank :float default(1.0), not null
# notify_user_count :integer default(0), not null
# subtype :string(255)
# slug :string(255)
# auto_close_at :datetime
# auto_close_user_id :integer
# auto_close_started_at :datetime
# deleted_by_id :integer
# participant_count :integer default(1)
# word_count :integer
# excerpt :string(1000)
# pinned_globally :boolean default(FALSE), not null
# auto_close_based_on_last_post :boolean default(FALSE)
# auto_close_hours :float
#
# Indexes
#

View File

@ -297,4 +297,5 @@ end
# Indexes
#
# index_topic_users_on_topic_id_and_user_id (topic_id,user_id) UNIQUE
# index_topic_users_on_user_id_and_topic_id (user_id,topic_id) UNIQUE
#

View File

@ -150,6 +150,7 @@ end
# updated_at :datetime not null
# sha1 :string(40)
# origin :string(1000)
# retain_hours :integer
#
# Indexes
#

View File

@ -875,12 +875,13 @@ end
# uploaded_avatar_id :integer
# email_always :boolean default(FALSE), not null
# mailing_list_mode :boolean default(FALSE), not null
# primary_group_id :integer
# locale :string(10)
# primary_group_id :integer
# registration_ip_address :inet
# last_redirected_to_top_at :datetime
# disable_jump_reply :boolean default(FALSE), not null
# edit_history_public :boolean default(FALSE), not null
# trust_level_locked :boolean default(FALSE), not null
#
# Indexes
#

View File

@ -1,3 +1,17 @@
class UserField < ActiveRecord::Base
validates_presence_of :name, :description, :field_type
end
# == Schema Information
#
# Table name: user_fields
#
# id :integer not null, primary key
# name :string(255) not null
# field_type :string(255) not null
# created_at :datetime
# updated_at :datetime
# editable :boolean default(FALSE), not null
# description :string(255) not null
# required :boolean default(TRUE), not null
#

View File

@ -126,6 +126,7 @@ end
# new_value :text
# topic_id :integer
# admin_only :boolean default(FALSE)
# post_id :integer
#
# Indexes
#

View File

@ -106,10 +106,12 @@ end
# website :string(255)
# bio_raw :text
# bio_cooked :text
# dismissed_banner_key :integer
# profile_background :string(255)
# card_background :string(255)
# dismissed_banner_key :integer
# bio_cooked_version :integer
# badge_granted_title :boolean default(FALSE)
# card_background :string(255)
# card_image_badge_id :integer
#
# Indexes
#

View File

@ -3,3 +3,20 @@ class Warning < ActiveRecord::Base
belongs_to :topic
belongs_to :created_by, class_name: 'User'
end
# == Schema Information
#
# Table name: warnings
#
# id :integer not null, primary key
# topic_id :integer not null
# user_id :integer not null
# created_by_id :integer not null
# created_at :datetime
# updated_at :datetime
#
# Indexes
#
# index_warnings_on_topic_id (topic_id) UNIQUE
# index_warnings_on_user_id (user_id)
#

View File

@ -0,0 +1,7 @@
class AddAllowedIpsToApiKeys < ActiveRecord::Migration
def change
change_table :api_keys do |t|
t.inet :allowed_ips, array: true
end
end
end