Merge remote-tracking branch 'upstream/pull/1659'

This commit is contained in:
Tom Hughes 2017-10-24 20:19:46 +01:00
commit f0b2ed9bb6
47 changed files with 1030 additions and 1 deletions

View file

@ -104,6 +104,7 @@ gem "logstasher"
# Gems useful for development
group :development do
gem "annotate"
gem "listen"
gem "vendorer"
end

View file

@ -43,6 +43,9 @@ GEM
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
annotate (2.7.2)
activerecord (>= 3.2, < 6.0)
rake (>= 10.4, < 13.0)
arel (7.1.4)
ast (2.3.0)
autoprefixer-rails (7.1.4.1)
@ -351,6 +354,7 @@ PLATFORMS
DEPENDENCIES
SystemTimer (>= 1.1.3)
actionpack-page_caching
annotate
autoprefixer-rails
bigdecimal (~> 1.1.0)
canonical-rails
@ -408,4 +412,4 @@ DEPENDENCIES
webmock
BUNDLED WITH
1.13.7
1.15.4

View file

@ -1,3 +1,40 @@
# == Schema Information
#
# Table name: oauth_tokens
#
# id :integer not null, primary key
# user_id :integer
# type :string(20)
# client_application_id :integer
# token :string(50)
# secret :string(50)
# authorized_at :datetime
# invalidated_at :datetime
# created_at :datetime
# updated_at :datetime
# allow_read_prefs :boolean default(FALSE), not null
# allow_write_prefs :boolean default(FALSE), not null
# allow_write_diary :boolean default(FALSE), not null
# allow_write_api :boolean default(FALSE), not null
# allow_read_gpx :boolean default(FALSE), not null
# allow_write_gpx :boolean default(FALSE), not null
# callback_url :string
# verifier :string(20)
# scope :string
# valid_to :datetime
# allow_write_notes :boolean default(FALSE), not null
#
# Indexes
#
# index_oauth_tokens_on_token (token) UNIQUE
# index_oauth_tokens_on_user_id (user_id)
#
# Foreign Keys
#
# oauth_tokens_client_application_id_fkey (client_application_id => client_applications.id)
# oauth_tokens_user_id_fkey (user_id => users.id)
#
class AccessToken < OauthToken
belongs_to :user
belongs_to :client_application

View file

@ -1,3 +1,18 @@
# == Schema Information
#
# Table name: acls
#
# id :integer not null, primary key
# address :inet
# k :string not null
# v :string
# domain :string
#
# Indexes
#
# acls_k_idx (k)
#
class Acl < ActiveRecord::Base
validates :k, :presence => true

View file

@ -1,3 +1,30 @@
# == Schema Information
#
# Table name: changesets
#
# id :integer not null, primary key
# user_id :integer not null
# created_at :datetime not null
# min_lat :integer
# max_lat :integer
# min_lon :integer
# max_lon :integer
# closed_at :datetime not null
# num_changes :integer default(0), not null
#
# Indexes
#
# changesets_bbox_idx (min_lat,max_lat,min_lon,max_lon)
# changesets_closed_at_idx (closed_at)
# changesets_created_at_idx (created_at)
# changesets_user_id_created_at_idx (user_id,created_at)
# changesets_user_id_id_idx (user_id,id)
#
# Foreign Keys
#
# changesets_user_id_fkey (user_id => users.id)
#
class Changeset < ActiveRecord::Base
require "xml/libxml"

View file

@ -1,3 +1,24 @@
# == Schema Information
#
# Table name: changeset_comments
#
# id :integer not null, primary key
# changeset_id :integer not null
# author_id :integer not null
# body :text not null
# created_at :datetime not null
# visible :boolean not null
#
# Indexes
#
# index_changeset_comments_on_created_at (created_at)
#
# Foreign Keys
#
# changeset_comments_author_id_fkey (author_id => users.id)
# changeset_comments_changeset_id_fkey (changeset_id => changesets.id)
#
class ChangesetComment < ActiveRecord::Base
belongs_to :changeset
belongs_to :author, :class_name => "User"

View file

@ -1,3 +1,20 @@
# == Schema Information
#
# Table name: changeset_tags
#
# changeset_id :integer not null, primary key
# k :string default(""), not null, primary key
# v :string default(""), not null
#
# Indexes
#
# changeset_tags_id_idx (changeset_id)
#
# Foreign Keys
#
# changeset_tags_id_fkey (changeset_id => changesets.id)
#
class ChangesetTag < ActiveRecord::Base
self.primary_keys = "changeset_id", "k"

View file

@ -1,3 +1,35 @@
# == Schema Information
#
# Table name: client_applications
#
# id :integer not null, primary key
# name :string
# url :string
# support_url :string
# callback_url :string
# key :string(50)
# secret :string(50)
# user_id :integer
# created_at :datetime
# updated_at :datetime
# allow_read_prefs :boolean default(FALSE), not null
# allow_write_prefs :boolean default(FALSE), not null
# allow_write_diary :boolean default(FALSE), not null
# allow_write_api :boolean default(FALSE), not null
# allow_read_gpx :boolean default(FALSE), not null
# allow_write_gpx :boolean default(FALSE), not null
# allow_write_notes :boolean default(FALSE), not null
#
# Indexes
#
# index_client_applications_on_key (key) UNIQUE
# index_client_applications_on_user_id (user_id)
#
# Foreign Keys
#
# client_applications_user_id_fkey (user_id => users.id)
#
require "oauth"
class ClientApplication < ActiveRecord::Base

View file

@ -1,3 +1,27 @@
# == Schema Information
#
# Table name: diary_comments
#
# id :integer not null, primary key
# diary_entry_id :integer not null
# user_id :integer not null
# body :text not null
# created_at :datetime not null
# updated_at :datetime not null
# visible :boolean default(TRUE), not null
# body_format :enum default("markdown"), not null
#
# Indexes
#
# diary_comment_user_id_created_at_index (user_id,created_at)
# diary_comments_entry_id_idx (diary_entry_id,id) UNIQUE
#
# Foreign Keys
#
# diary_comments_diary_entry_id_fkey (diary_entry_id => diary_entries.id)
# diary_comments_user_id_fkey (user_id => users.id)
#
class DiaryComment < ActiveRecord::Base
belongs_to :user
belongs_to :diary_entry

View file

@ -1,3 +1,31 @@
# == Schema Information
#
# Table name: diary_entries
#
# id :integer not null, primary key
# user_id :integer not null
# title :string not null
# body :text not null
# created_at :datetime not null
# updated_at :datetime not null
# latitude :float
# longitude :float
# language_code :string default("en"), not null
# visible :boolean default(TRUE), not null
# body_format :enum default("markdown"), not null
#
# Indexes
#
# diary_entry_created_at_index (created_at)
# diary_entry_language_code_created_at_index (language_code,created_at)
# diary_entry_user_id_created_at_index (user_id,created_at)
#
# Foreign Keys
#
# diary_entries_language_code_fkey (language_code => languages.code)
# diary_entries_user_id_fkey (user_id => users.id)
#
class DiaryEntry < ActiveRecord::Base
belongs_to :user, :counter_cache => true
belongs_to :language, :foreign_key => "language_code"

View file

@ -1,3 +1,20 @@
# == Schema Information
#
# Table name: diary_entry_subscriptions
#
# user_id :integer not null, primary key
# diary_entry_id :integer not null, primary key
#
# Indexes
#
# index_diary_entry_subscriptions_on_diary_entry_id (diary_entry_id)
#
# Foreign Keys
#
# diary_entry_subscriptions_diary_entry_id_fkey (diary_entry_id => diary_entries.id)
# diary_entry_subscriptions_user_id_fkey (user_id => users.id)
#
class DiaryEntrySubscription < ActiveRecord::Base
self.primary_keys = "user_id", "diary_entry_id"

View file

@ -1,3 +1,22 @@
# == Schema Information
#
# Table name: friends
#
# id :integer not null, primary key
# user_id :integer not null
# friend_user_id :integer not null
#
# Indexes
#
# friends_user_id_idx (user_id)
# user_id_idx (friend_user_id)
#
# Foreign Keys
#
# friends_friend_user_id_fkey (friend_user_id => users.id)
# friends_user_id_fkey (user_id => users.id)
#
class Friend < ActiveRecord::Base
belongs_to :befriender, :class_name => "User", :foreign_key => :user_id
belongs_to :befriendee, :class_name => "User", :foreign_key => :friend_user_id

View file

@ -1,3 +1,12 @@
# == Schema Information
#
# Table name: languages
#
# code :string not null, primary key
# english_name :string not null
# native_name :string
#
class Language < ActiveRecord::Base
self.primary_key = "code"

View file

@ -1,3 +1,29 @@
# == Schema Information
#
# Table name: messages
#
# id :integer not null, primary key
# from_user_id :integer not null
# title :string not null
# body :text not null
# sent_on :datetime not null
# message_read :boolean default(FALSE), not null
# to_user_id :integer not null
# to_user_visible :boolean default(TRUE), not null
# from_user_visible :boolean default(TRUE), not null
# body_format :enum default("markdown"), not null
#
# Indexes
#
# messages_from_user_id_idx (from_user_id)
# messages_to_user_id_idx (to_user_id)
#
# Foreign Keys
#
# messages_from_user_id_fkey (from_user_id => users.id)
# messages_to_user_id_fkey (to_user_id => users.id)
#
require "validators"
class Message < ActiveRecord::Base

View file

@ -1,3 +1,26 @@
# == Schema Information
#
# Table name: current_nodes
#
# id :integer not null, primary key
# latitude :integer not null
# longitude :integer not null
# changeset_id :integer not null
# visible :boolean not null
# timestamp :datetime not null
# tile :integer not null
# version :integer not null
#
# Indexes
#
# current_nodes_tile_idx (tile)
# current_nodes_timestamp_idx (timestamp)
#
# Foreign Keys
#
# current_nodes_changeset_id_fkey (changeset_id => changesets.id)
#
class Node < ActiveRecord::Base
require "xml/libxml"

View file

@ -1,3 +1,16 @@
# == Schema Information
#
# Table name: current_node_tags
#
# node_id :integer not null, primary key
# k :string default(""), not null, primary key
# v :string default(""), not null
#
# Foreign Keys
#
# current_node_tags_id_fkey (node_id => current_nodes.id)
#
class NodeTag < ActiveRecord::Base
self.table_name = "current_node_tags"
self.primary_keys = "node_id", "k"

View file

@ -1,3 +1,23 @@
# == Schema Information
#
# Table name: notes
#
# id :integer not null, primary key
# latitude :integer not null
# longitude :integer not null
# tile :integer not null
# updated_at :datetime not null
# created_at :datetime not null
# status :enum not null
# closed_at :datetime
#
# Indexes
#
# notes_created_at_idx (created_at)
# notes_tile_status_idx (tile,status)
# notes_updated_at_idx (updated_at)
#
class Note < ActiveRecord::Base
include GeoRecord

View file

@ -1,3 +1,28 @@
# == Schema Information
#
# Table name: note_comments
#
# id :integer not null, primary key
# note_id :integer not null
# visible :boolean not null
# created_at :datetime not null
# author_ip :inet
# author_id :integer
# body :text
# event :enum
#
# Indexes
#
# index_note_comments_on_body (to_tsvector('english'::regconfig, body))
# index_note_comments_on_created_at (created_at)
# note_comments_note_id_idx (note_id)
#
# Foreign Keys
#
# note_comments_author_id_fkey (author_id => users.id)
# note_comments_note_id_fkey (note_id => notes.id)
#
class NoteComment < ActiveRecord::Base
belongs_to :note, :foreign_key => :note_id, :touch => true
belongs_to :author, :class_name => "User", :foreign_key => :author_id

View file

@ -1,3 +1,40 @@
# == Schema Information
#
# Table name: oauth_tokens
#
# id :integer not null, primary key
# user_id :integer
# type :string(20)
# client_application_id :integer
# token :string(50)
# secret :string(50)
# authorized_at :datetime
# invalidated_at :datetime
# created_at :datetime
# updated_at :datetime
# allow_read_prefs :boolean default(FALSE), not null
# allow_write_prefs :boolean default(FALSE), not null
# allow_write_diary :boolean default(FALSE), not null
# allow_write_api :boolean default(FALSE), not null
# allow_read_gpx :boolean default(FALSE), not null
# allow_write_gpx :boolean default(FALSE), not null
# callback_url :string
# verifier :string(20)
# scope :string
# valid_to :datetime
# allow_write_notes :boolean default(FALSE), not null
#
# Indexes
#
# index_oauth_tokens_on_token (token) UNIQUE
# index_oauth_tokens_on_user_id (user_id)
#
# Foreign Keys
#
# oauth_tokens_client_application_id_fkey (client_application_id => client_applications.id)
# oauth_tokens_user_id_fkey (user_id => users.id)
#
class Oauth2Token < AccessToken
attr_accessor :state

View file

@ -1,3 +1,40 @@
# == Schema Information
#
# Table name: oauth_tokens
#
# id :integer not null, primary key
# user_id :integer
# type :string(20)
# client_application_id :integer
# token :string(50)
# secret :string(50)
# authorized_at :datetime
# invalidated_at :datetime
# created_at :datetime
# updated_at :datetime
# allow_read_prefs :boolean default(FALSE), not null
# allow_write_prefs :boolean default(FALSE), not null
# allow_write_diary :boolean default(FALSE), not null
# allow_write_api :boolean default(FALSE), not null
# allow_read_gpx :boolean default(FALSE), not null
# allow_write_gpx :boolean default(FALSE), not null
# callback_url :string
# verifier :string(20)
# scope :string
# valid_to :datetime
# allow_write_notes :boolean default(FALSE), not null
#
# Indexes
#
# index_oauth_tokens_on_token (token) UNIQUE
# index_oauth_tokens_on_user_id (user_id)
#
# Foreign Keys
#
# oauth_tokens_client_application_id_fkey (client_application_id => client_applications.id)
# oauth_tokens_user_id_fkey (user_id => users.id)
#
class Oauth2Verifier < OauthToken
validates :user, :presence => true, :associated => true

View file

@ -1,3 +1,18 @@
# == Schema Information
#
# Table name: oauth_nonces
#
# id :integer not null, primary key
# nonce :string
# timestamp :integer
# created_at :datetime
# updated_at :datetime
#
# Indexes
#
# index_oauth_nonces_on_nonce_and_timestamp (nonce,timestamp) UNIQUE
#
# Simple store of nonces. The OAuth Spec requires that any given pair of nonce and timestamps are unique.
# Thus you can use the same nonce with a different timestamp and viceversa.
class OauthNonce < ActiveRecord::Base

View file

@ -1,3 +1,40 @@
# == Schema Information
#
# Table name: oauth_tokens
#
# id :integer not null, primary key
# user_id :integer
# type :string(20)
# client_application_id :integer
# token :string(50)
# secret :string(50)
# authorized_at :datetime
# invalidated_at :datetime
# created_at :datetime
# updated_at :datetime
# allow_read_prefs :boolean default(FALSE), not null
# allow_write_prefs :boolean default(FALSE), not null
# allow_write_diary :boolean default(FALSE), not null
# allow_write_api :boolean default(FALSE), not null
# allow_read_gpx :boolean default(FALSE), not null
# allow_write_gpx :boolean default(FALSE), not null
# callback_url :string
# verifier :string(20)
# scope :string
# valid_to :datetime
# allow_write_notes :boolean default(FALSE), not null
#
# Indexes
#
# index_oauth_tokens_on_token (token) UNIQUE
# index_oauth_tokens_on_user_id (user_id)
#
# Foreign Keys
#
# oauth_tokens_client_application_id_fkey (client_application_id => client_applications.id)
# oauth_tokens_user_id_fkey (user_id => users.id)
#
class OauthToken < ActiveRecord::Base
belongs_to :client_application
belongs_to :user

View file

@ -1,3 +1,29 @@
# == Schema Information
#
# Table name: nodes
#
# node_id :integer not null, primary key
# latitude :integer not null
# longitude :integer not null
# changeset_id :integer not null
# visible :boolean not null
# timestamp :datetime not null
# tile :integer not null
# version :integer not null, primary key
# redaction_id :integer
#
# Indexes
#
# nodes_changeset_id_idx (changeset_id)
# nodes_tile_idx (tile)
# nodes_timestamp_idx (timestamp)
#
# Foreign Keys
#
# nodes_changeset_id_fkey (changeset_id => changesets.id)
# nodes_redaction_id_fkey (redaction_id => redactions.id)
#
class OldNode < ActiveRecord::Base
include GeoRecord
include ConsistencyValidations

View file

@ -1,3 +1,17 @@
# == Schema Information
#
# Table name: node_tags
#
# node_id :integer not null, primary key
# version :integer not null, primary key
# k :string default(""), not null, primary key
# v :string default(""), not null
#
# Foreign Keys
#
# node_tags_id_fkey (node_id => nodes.node_id)
#
class OldNodeTag < ActiveRecord::Base
self.table_name = "node_tags"
self.primary_keys = "node_id", "version", "k"

View file

@ -1,3 +1,25 @@
# == Schema Information
#
# Table name: relations
#
# relation_id :integer default(0), not null, primary key
# changeset_id :integer not null
# timestamp :datetime not null
# version :integer not null, primary key
# visible :boolean default(TRUE), not null
# redaction_id :integer
#
# Indexes
#
# relations_changeset_id_idx (changeset_id)
# relations_timestamp_idx (timestamp)
#
# Foreign Keys
#
# relations_changeset_id_fkey (changeset_id => changesets.id)
# relations_redaction_id_fkey (redaction_id => redactions.id)
#
class OldRelation < ActiveRecord::Base
include ConsistencyValidations
include ObjectMetadata

View file

@ -1,3 +1,23 @@
# == Schema Information
#
# Table name: relation_members
#
# relation_id :integer default(0), not null, primary key
# member_type :enum not null
# member_id :integer not null
# member_role :string not null
# version :integer default(0), not null, primary key
# sequence_id :integer default(0), not null, primary key
#
# Indexes
#
# relation_members_member_idx (member_type,member_id)
#
# Foreign Keys
#
# relation_members_id_fkey (relation_id => relations.relation_id)
#
class OldRelationMember < ActiveRecord::Base
self.table_name = "relation_members"
self.primary_keys = "relation_id", "version", "sequence_id"

View file

@ -1,3 +1,17 @@
# == Schema Information
#
# Table name: relation_tags
#
# relation_id :integer default(0), not null, primary key
# k :string default(""), not null, primary key
# v :string default(""), not null
# version :integer not null, primary key
#
# Foreign Keys
#
# relation_tags_id_fkey (relation_id => relations.relation_id)
#
class OldRelationTag < ActiveRecord::Base
self.table_name = "relation_tags"
self.primary_keys = "relation_id", "version", "k"

View file

@ -1,3 +1,25 @@
# == Schema Information
#
# Table name: ways
#
# way_id :integer default(0), not null, primary key
# changeset_id :integer not null
# timestamp :datetime not null
# version :integer not null, primary key
# visible :boolean default(TRUE), not null
# redaction_id :integer
#
# Indexes
#
# ways_changeset_id_idx (changeset_id)
# ways_timestamp_idx (timestamp)
#
# Foreign Keys
#
# ways_changeset_id_fkey (changeset_id => changesets.id)
# ways_redaction_id_fkey (redaction_id => redactions.id)
#
class OldWay < ActiveRecord::Base
include ConsistencyValidations
include ObjectMetadata

View file

@ -1,3 +1,21 @@
# == Schema Information
#
# Table name: way_nodes
#
# way_id :integer not null, primary key
# node_id :integer not null
# version :integer not null, primary key
# sequence_id :integer not null, primary key
#
# Indexes
#
# way_nodes_node_idx (node_id)
#
# Foreign Keys
#
# way_nodes_id_fkey (way_id => ways.way_id)
#
class OldWayNode < ActiveRecord::Base
self.table_name = "way_nodes"
self.primary_keys = "way_id", "version", "sequence_id"

View file

@ -1,3 +1,17 @@
# == Schema Information
#
# Table name: way_tags
#
# way_id :integer default(0), not null, primary key
# k :string not null, primary key
# v :string not null
# version :integer not null, primary key
#
# Foreign Keys
#
# way_tags_id_fkey (way_id => ways.way_id)
#
class OldWayTag < ActiveRecord::Base
self.table_name = "way_tags"
self.primary_keys = "way_id", "version", "k"

View file

@ -1,3 +1,20 @@
# == Schema Information
#
# Table name: redactions
#
# id :integer not null, primary key
# title :string
# description :text
# created_at :datetime
# updated_at :datetime
# user_id :integer not null
# description_format :enum default("markdown"), not null
#
# Foreign Keys
#
# redactions_user_id_fkey (user_id => users.id)
#
##
# Redaction represents a record associated with a particular
# action on the database to hide revisions from the history

View file

@ -1,3 +1,22 @@
# == Schema Information
#
# Table name: current_relations
#
# id :integer not null, primary key
# changeset_id :integer not null
# timestamp :datetime not null
# visible :boolean not null
# version :integer not null
#
# Indexes
#
# current_relations_timestamp_idx (timestamp)
#
# Foreign Keys
#
# current_relations_changeset_id_fkey (changeset_id => changesets.id)
#
class Relation < ActiveRecord::Base
require "xml/libxml"

View file

@ -1,3 +1,22 @@
# == Schema Information
#
# Table name: current_relation_members
#
# relation_id :integer not null, primary key
# member_type :enum not null
# member_id :integer not null
# member_role :string not null
# sequence_id :integer default(0), not null, primary key
#
# Indexes
#
# current_relation_members_member_idx (member_type,member_id)
#
# Foreign Keys
#
# current_relation_members_id_fkey (relation_id => current_relations.id)
#
class RelationMember < ActiveRecord::Base
self.table_name = "current_relation_members"
self.primary_keys = "relation_id", "sequence_id"

View file

@ -1,3 +1,16 @@
# == Schema Information
#
# Table name: current_relation_tags
#
# relation_id :integer not null, primary key
# k :string default(""), not null, primary key
# v :string default(""), not null
#
# Foreign Keys
#
# current_relation_tags_id_fkey (relation_id => current_relations.id)
#
class RelationTag < ActiveRecord::Base
self.table_name = "current_relation_tags"
self.primary_keys = "relation_id", "k"

View file

@ -1,3 +1,40 @@
# == Schema Information
#
# Table name: oauth_tokens
#
# id :integer not null, primary key
# user_id :integer
# type :string(20)
# client_application_id :integer
# token :string(50)
# secret :string(50)
# authorized_at :datetime
# invalidated_at :datetime
# created_at :datetime
# updated_at :datetime
# allow_read_prefs :boolean default(FALSE), not null
# allow_write_prefs :boolean default(FALSE), not null
# allow_write_diary :boolean default(FALSE), not null
# allow_write_api :boolean default(FALSE), not null
# allow_read_gpx :boolean default(FALSE), not null
# allow_write_gpx :boolean default(FALSE), not null
# callback_url :string
# verifier :string(20)
# scope :string
# valid_to :datetime
# allow_write_notes :boolean default(FALSE), not null
#
# Indexes
#
# index_oauth_tokens_on_token (token) UNIQUE
# index_oauth_tokens_on_user_id (user_id)
#
# Foreign Keys
#
# oauth_tokens_client_application_id_fkey (client_application_id => client_applications.id)
# oauth_tokens_user_id_fkey (user_id => users.id)
#
class RequestToken < OauthToken
attr_accessor :provided_oauth_verifier

View file

@ -1,3 +1,30 @@
# == Schema Information
#
# Table name: gpx_files
#
# id :integer not null, primary key
# user_id :integer not null
# visible :boolean default(TRUE), not null
# name :string default(""), not null
# size :integer
# latitude :float
# longitude :float
# timestamp :datetime not null
# description :string default(""), not null
# inserted :boolean not null
# visibility :enum default("public"), not null
#
# Indexes
#
# gpx_files_timestamp_idx (timestamp)
# gpx_files_user_id_idx (user_id)
# gpx_files_visible_visibility_idx (visible,visibility)
#
# Foreign Keys
#
# gpx_files_user_id_fkey (user_id => users.id)
#
class Trace < ActiveRecord::Base
self.table_name = "gpx_files"

View file

@ -1,3 +1,25 @@
# == Schema Information
#
# Table name: gps_points
#
# altitude :float
# trackid :integer not null
# latitude :integer not null
# longitude :integer not null
# gpx_id :integer not null
# timestamp :datetime
# tile :integer
#
# Indexes
#
# points_gpxid_idx (gpx_id)
# points_tile_idx (tile)
#
# Foreign Keys
#
# gps_points_gpx_id_fkey (gpx_id => gpx_files.id)
#
class Tracepoint < ActiveRecord::Base
include GeoRecord

View file

@ -1,3 +1,21 @@
# == Schema Information
#
# Table name: gpx_file_tags
#
# gpx_id :integer default(0), not null
# tag :string not null
# id :integer not null, primary key
#
# Indexes
#
# gpx_file_tags_gpxid_idx (gpx_id)
# gpx_file_tags_tag_idx (tag)
#
# Foreign Keys
#
# gpx_file_tags_gpx_id_fkey (gpx_id => gpx_files.id)
#
class Tracetag < ActiveRecord::Base
self.table_name = "gpx_file_tags"

View file

@ -1,3 +1,48 @@
# == Schema Information
#
# Table name: users
#
# email :string not null
# id :integer not null, primary key
# pass_crypt :string not null
# creation_time :datetime not null
# display_name :string default(""), not null
# data_public :boolean default(FALSE), not null
# description :text default(""), not null
# home_lat :float
# home_lon :float
# home_zoom :integer default(3)
# nearby :integer default(50)
# pass_salt :string
# image_file_name :text
# email_valid :boolean default(FALSE), not null
# new_email :string
# creation_ip :string
# languages :string
# status :enum default("pending"), not null
# terms_agreed :datetime
# consider_pd :boolean default(FALSE), not null
# auth_uid :string
# preferred_editor :string
# terms_seen :boolean default(FALSE), not null
# description_format :enum default("markdown"), not null
# image_fingerprint :string
# changesets_count :integer default(0), not null
# traces_count :integer default(0), not null
# diary_entries_count :integer default(0), not null
# image_use_gravatar :boolean default(FALSE), not null
# image_content_type :string
# auth_provider :string
#
# Indexes
#
# users_auth_idx (auth_provider,auth_uid) UNIQUE
# users_display_name_idx (display_name) UNIQUE
# users_display_name_lower_idx (lower((display_name)::text))
# users_email_idx (email) UNIQUE
# users_email_lower_idx (lower((email)::text))
#
class User < ActiveRecord::Base
require "xml/libxml"

View file

@ -1,3 +1,29 @@
# == Schema Information
#
# Table name: user_blocks
#
# id :integer not null, primary key
# user_id :integer not null
# creator_id :integer not null
# reason :text not null
# ends_at :datetime not null
# needs_view :boolean default(FALSE), not null
# revoker_id :integer
# created_at :datetime
# updated_at :datetime
# reason_format :enum default("markdown"), not null
#
# Indexes
#
# index_user_blocks_on_user_id (user_id)
#
# Foreign Keys
#
# user_blocks_moderator_id_fkey (creator_id => users.id)
# user_blocks_revoker_id_fkey (revoker_id => users.id)
# user_blocks_user_id_fkey (user_id => users.id)
#
class UserBlock < ActiveRecord::Base
validate :moderator_permissions

View file

@ -1,3 +1,16 @@
# == Schema Information
#
# Table name: user_preferences
#
# user_id :integer not null, primary key
# k :string not null, primary key
# v :string not null
#
# Foreign Keys
#
# user_preferences_user_id_fkey (user_id => users.id)
#
class UserPreference < ActiveRecord::Base
self.primary_keys = "user_id", "k"

View file

@ -1,3 +1,24 @@
# == Schema Information
#
# Table name: user_roles
#
# id :integer not null, primary key
# user_id :integer not null
# role :enum not null
# created_at :datetime
# updated_at :datetime
# granter_id :integer not null
#
# Indexes
#
# user_roles_id_role_unique (user_id,role) UNIQUE
#
# Foreign Keys
#
# user_roles_granter_id_fkey (granter_id => users.id)
# user_roles_user_id_fkey (user_id => users.id)
#
class UserRole < ActiveRecord::Base
belongs_to :user
belongs_to :granter, :class_name => "User"

View file

@ -1,3 +1,23 @@
# == Schema Information
#
# Table name: user_tokens
#
# id :integer not null, primary key
# user_id :integer not null
# token :string not null
# expiry :datetime not null
# referer :text
#
# Indexes
#
# user_tokens_token_idx (token) UNIQUE
# user_tokens_user_id_idx (user_id)
#
# Foreign Keys
#
# user_tokens_user_id_fkey (user_id => users.id)
#
class UserToken < ActiveRecord::Base
belongs_to :user

View file

@ -1,3 +1,22 @@
# == Schema Information
#
# Table name: current_ways
#
# id :integer not null, primary key
# changeset_id :integer not null
# timestamp :datetime not null
# visible :boolean not null
# version :integer not null
#
# Indexes
#
# current_ways_timestamp_idx (timestamp)
#
# Foreign Keys
#
# current_ways_changeset_id_fkey (changeset_id => changesets.id)
#
class Way < ActiveRecord::Base
require "xml/libxml"

View file

@ -1,3 +1,21 @@
# == Schema Information
#
# Table name: current_way_nodes
#
# way_id :integer not null, primary key
# node_id :integer not null
# sequence_id :integer not null, primary key
#
# Indexes
#
# current_way_nodes_node_idx (node_id)
#
# Foreign Keys
#
# current_way_nodes_id_fkey (way_id => current_ways.id)
# current_way_nodes_node_id_fkey (node_id => current_nodes.id)
#
class WayNode < ActiveRecord::Base
self.table_name = "current_way_nodes"
self.primary_keys = "way_id", "sequence_id"

View file

@ -1,3 +1,16 @@
# == Schema Information
#
# Table name: current_way_tags
#
# way_id :integer not null, primary key
# k :string default(""), not null, primary key
# v :string default(""), not null
#
# Foreign Keys
#
# current_way_tags_id_fkey (way_id => current_ways.id)
#
class WayTag < ActiveRecord::Base
self.table_name = "current_way_tags"
self.primary_keys = "way_id", "k"

View file

@ -0,0 +1,48 @@
# NOTE: only doing this in development as some production environments (Heroku)
# NOTE: are sensitive to local FS writes, and besides -- it's just not proper
# NOTE: to have a dev-mode tool do its thing in production.
if Rails.env.development?
task :set_annotation_options do
# You can override any of these by setting an environment variable of the
# same name.
Annotate.set_defaults(
"routes" => "false",
"position_in_routes" => "before",
"position_in_class" => "before",
"position_in_test" => "before",
"position_in_fixture" => "before",
"position_in_factory" => "before",
"position_in_serializer" => "before",
"show_foreign_keys" => "true",
"show_indexes" => "true",
"simple_indexes" => "false",
"model_dir" => "app/models",
"root_dir" => "",
"include_version" => "false",
"require" => "",
"exclude_tests" => "true",
"exclude_fixtures" => "true",
"exclude_factories" => "true",
"exclude_serializers" => "true",
"exclude_scaffolds" => "true",
"exclude_controllers" => "true",
"exclude_helpers" => "true",
"ignore_model_sub_dir" => "false",
"ignore_columns" => nil,
"ignore_routes" => nil,
"ignore_unknown_models" => "false",
"hide_limit_column_types" => "integer,boolean",
"skip_on_db_migrate" => "false",
"format_bare" => "true",
"format_rdoc" => "false",
"format_markdown" => "false",
"sort" => "false",
"force" => "false",
"trace" => "false",
"wrapper_open" => nil,
"wrapper_close" => nil
)
end
Annotate.load_tasks
end