ferblape-query_memcached 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -0
- data/MIT-LICENSE +20 -0
- data/README.markdown +87 -0
- data/RUNNING_TESTS +18 -0
- data/Rakefile +37 -0
- data/TODO +6 -0
- data/init.rb +3 -0
- data/lib/extensions/lock.rb +31 -0
- data/lib/query_memcached.rb +191 -0
- data/test/query_memcached_test.rb +26 -0
- data/test/testing_app/README +1 -0
- data/test/testing_app/Rakefile +8 -0
- data/test/testing_app/app/controllers/application.rb +15 -0
- data/test/testing_app/app/helpers/application_helper.rb +3 -0
- data/test/testing_app/app/models/author.rb +133 -0
- data/test/testing_app/app/models/auto_id.rb +4 -0
- data/test/testing_app/app/models/binary.rb +2 -0
- data/test/testing_app/app/models/book.rb +4 -0
- data/test/testing_app/app/models/categorization.rb +5 -0
- data/test/testing_app/app/models/category.rb +29 -0
- data/test/testing_app/app/models/citation.rb +6 -0
- data/test/testing_app/app/models/club.rb +7 -0
- data/test/testing_app/app/models/column_name.rb +3 -0
- data/test/testing_app/app/models/comment.rb +25 -0
- data/test/testing_app/app/models/company.rb +123 -0
- data/test/testing_app/app/models/company_in_module.rb +61 -0
- data/test/testing_app/app/models/computer.rb +4 -0
- data/test/testing_app/app/models/contact.rb +16 -0
- data/test/testing_app/app/models/course.rb +3 -0
- data/test/testing_app/app/models/customer.rb +55 -0
- data/test/testing_app/app/models/default.rb +2 -0
- data/test/testing_app/app/models/developer.rb +76 -0
- data/test/testing_app/app/models/edge.rb +5 -0
- data/test/testing_app/app/models/entrant.rb +3 -0
- data/test/testing_app/app/models/guid.rb +2 -0
- data/test/testing_app/app/models/item.rb +7 -0
- data/test/testing_app/app/models/job.rb +5 -0
- data/test/testing_app/app/models/joke.rb +3 -0
- data/test/testing_app/app/models/keyboard.rb +3 -0
- data/test/testing_app/app/models/legacy_thing.rb +3 -0
- data/test/testing_app/app/models/matey.rb +4 -0
- data/test/testing_app/app/models/member.rb +9 -0
- data/test/testing_app/app/models/membership.rb +9 -0
- data/test/testing_app/app/models/minimalistic.rb +2 -0
- data/test/testing_app/app/models/mixed_case_monkey.rb +3 -0
- data/test/testing_app/app/models/movie.rb +5 -0
- data/test/testing_app/app/models/order.rb +4 -0
- data/test/testing_app/app/models/owner.rb +4 -0
- data/test/testing_app/app/models/parrot.rb +13 -0
- data/test/testing_app/app/models/person.rb +10 -0
- data/test/testing_app/app/models/pet.rb +4 -0
- data/test/testing_app/app/models/pirate.rb +9 -0
- data/test/testing_app/app/models/post.rb +80 -0
- data/test/testing_app/app/models/price_estimate.rb +3 -0
- data/test/testing_app/app/models/project.rb +29 -0
- data/test/testing_app/app/models/reader.rb +4 -0
- data/test/testing_app/app/models/reference.rb +4 -0
- data/test/testing_app/app/models/reply.rb +39 -0
- data/test/testing_app/app/models/ship.rb +3 -0
- data/test/testing_app/app/models/sponsor.rb +4 -0
- data/test/testing_app/app/models/subject.rb +4 -0
- data/test/testing_app/app/models/subscriber.rb +8 -0
- data/test/testing_app/app/models/subscription.rb +4 -0
- data/test/testing_app/app/models/tag.rb +7 -0
- data/test/testing_app/app/models/tagging.rb +10 -0
- data/test/testing_app/app/models/task.rb +2 -0
- data/test/testing_app/app/models/topic.rb +65 -0
- data/test/testing_app/app/models/treasure.rb +6 -0
- data/test/testing_app/app/models/vertex.rb +9 -0
- data/test/testing_app/app/models/warehouse_thing.rb +5 -0
- data/test/testing_app/config/boot.rb +109 -0
- data/test/testing_app/config/database.yml +11 -0
- data/test/testing_app/config/environment.rb +19 -0
- data/test/testing_app/config/environments/development.rb +0 -0
- data/test/testing_app/config/environments/production.rb +0 -0
- data/test/testing_app/config/environments/test.rb +0 -0
- data/test/testing_app/config/initializers/inflections.rb +10 -0
- data/test/testing_app/config/initializers/mime_types.rb +5 -0
- data/test/testing_app/config/initializers/new_rails_defaults.rb +15 -0
- data/test/testing_app/config/routes.rb +41 -0
- data/test/testing_app/db/schema.rb +443 -0
- data/test/testing_app/script/about +3 -0
- data/test/testing_app/script/console +3 -0
- data/test/testing_app/script/dbconsole +3 -0
- data/test/testing_app/script/destroy +3 -0
- data/test/testing_app/script/generate +3 -0
- data/test/testing_app/script/performance/benchmarker +3 -0
- data/test/testing_app/script/performance/profiler +3 -0
- data/test/testing_app/script/performance/request +3 -0
- data/test/testing_app/script/plugin +3 -0
- data/test/testing_app/script/process/inspector +3 -0
- data/test/testing_app/script/process/reaper +3 -0
- data/test/testing_app/script/process/spawner +3 -0
- data/test/testing_app/script/runner +3 -0
- data/test/testing_app/script/server +3 -0
- data/test/testing_app/test/fixtures/accounts.yml +28 -0
- data/test/testing_app/test/fixtures/all/developers.yml +0 -0
- data/test/testing_app/test/fixtures/all/people.csv +0 -0
- data/test/testing_app/test/fixtures/all/tasks.yml +0 -0
- data/test/testing_app/test/fixtures/author_addresses.yml +5 -0
- data/test/testing_app/test/fixtures/author_favorites.yml +4 -0
- data/test/testing_app/test/fixtures/authors.yml +9 -0
- data/test/testing_app/test/fixtures/binaries.yml +132 -0
- data/test/testing_app/test/fixtures/books.yml +7 -0
- data/test/testing_app/test/fixtures/categories.yml +14 -0
- data/test/testing_app/test/fixtures/categories/special_categories.yml +9 -0
- data/test/testing_app/test/fixtures/categories/subsubdir/arbitrary_filename.yml +4 -0
- data/test/testing_app/test/fixtures/categories_posts.yml +23 -0
- data/test/testing_app/test/fixtures/categorizations.yml +17 -0
- data/test/testing_app/test/fixtures/clubs.yml +6 -0
- data/test/testing_app/test/fixtures/comments.yml +59 -0
- data/test/testing_app/test/fixtures/companies.yml +55 -0
- data/test/testing_app/test/fixtures/computers.yml +4 -0
- data/test/testing_app/test/fixtures/courses.yml +7 -0
- data/test/testing_app/test/fixtures/customers.yml +17 -0
- data/test/testing_app/test/fixtures/developers.yml +21 -0
- data/test/testing_app/test/fixtures/developers_projects.yml +17 -0
- data/test/testing_app/test/fixtures/edges.yml +6 -0
- data/test/testing_app/test/fixtures/entrants.yml +14 -0
- data/test/testing_app/test/fixtures/fk_test_has_fk.yml +3 -0
- data/test/testing_app/test/fixtures/fk_test_has_pk.yml +2 -0
- data/test/testing_app/test/fixtures/funny_jokes.yml +10 -0
- data/test/testing_app/test/fixtures/items.yml +4 -0
- data/test/testing_app/test/fixtures/jobs.yml +7 -0
- data/test/testing_app/test/fixtures/legacy_things.yml +3 -0
- data/test/testing_app/test/fixtures/mateys.yml +4 -0
- data/test/testing_app/test/fixtures/members.yml +4 -0
- data/test/testing_app/test/fixtures/memberships.yml +20 -0
- data/test/testing_app/test/fixtures/minimalistics.yml +2 -0
- data/test/testing_app/test/fixtures/mixed_case_monkeys.yml +6 -0
- data/test/testing_app/test/fixtures/mixins.yml +29 -0
- data/test/testing_app/test/fixtures/movies.yml +7 -0
- data/test/testing_app/test/fixtures/naked/csv/accounts.csv +1 -0
- data/test/testing_app/test/fixtures/naked/yml/accounts.yml +1 -0
- data/test/testing_app/test/fixtures/naked/yml/companies.yml +1 -0
- data/test/testing_app/test/fixtures/naked/yml/courses.yml +1 -0
- data/test/testing_app/test/fixtures/owners.yml +7 -0
- data/test/testing_app/test/fixtures/parrots.yml +27 -0
- data/test/testing_app/test/fixtures/parrots_pirates.yml +7 -0
- data/test/testing_app/test/fixtures/people.yml +6 -0
- data/test/testing_app/test/fixtures/pets.yml +14 -0
- data/test/testing_app/test/fixtures/pirates.yml +9 -0
- data/test/testing_app/test/fixtures/posts.yml +49 -0
- data/test/testing_app/test/fixtures/price_estimates.yml +7 -0
- data/test/testing_app/test/fixtures/projects.yml +7 -0
- data/test/testing_app/test/fixtures/readers.yml +9 -0
- data/test/testing_app/test/fixtures/references.yml +17 -0
- data/test/testing_app/test/fixtures/reserved_words/distinct.yml +5 -0
- data/test/testing_app/test/fixtures/reserved_words/distincts_selects.yml +11 -0
- data/test/testing_app/test/fixtures/reserved_words/group.yml +14 -0
- data/test/testing_app/test/fixtures/reserved_words/select.yml +8 -0
- data/test/testing_app/test/fixtures/reserved_words/values.yml +7 -0
- data/test/testing_app/test/fixtures/ships.yml +5 -0
- data/test/testing_app/test/fixtures/sponsors.yml +9 -0
- data/test/testing_app/test/fixtures/subscribers.yml +7 -0
- data/test/testing_app/test/fixtures/subscriptions.yml +12 -0
- data/test/testing_app/test/fixtures/taggings.yml +28 -0
- data/test/testing_app/test/fixtures/tags.yml +7 -0
- data/test/testing_app/test/fixtures/tasks.yml +7 -0
- data/test/testing_app/test/fixtures/topics.yml +42 -0
- data/test/testing_app/test/fixtures/treasures.yml +10 -0
- data/test/testing_app/test/fixtures/vertices.yml +4 -0
- data/test/testing_app/test/fixtures/warehouse-things.yml +3 -0
- data/test/testing_app/test/test_helper.rb +131 -0
- data/test/testing_app/test/unit/query_cache_test.rb +180 -0
- metadata +289 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
# test that attr_readonly isn't called on the :taggable polymorphic association
|
2
|
+
module Taggable
|
3
|
+
end
|
4
|
+
|
5
|
+
class Tagging < ActiveRecord::Base
|
6
|
+
belongs_to :tag, :include => :tagging
|
7
|
+
belongs_to :super_tag, :class_name => 'Tag', :foreign_key => 'super_tag_id'
|
8
|
+
belongs_to :invalid_tag, :class_name => 'Tag', :foreign_key => 'tag_id'
|
9
|
+
belongs_to :taggable, :polymorphic => true, :counter_cache => true
|
10
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
class Topic < ActiveRecord::Base
|
2
|
+
named_scope :base
|
3
|
+
named_scope :written_before, lambda { |time|
|
4
|
+
{ :conditions => ['written_on < ?', time] }
|
5
|
+
}
|
6
|
+
named_scope :approved, :conditions => {:approved => true}
|
7
|
+
named_scope :replied, :conditions => ['replies_count > 0']
|
8
|
+
named_scope :anonymous_extension do
|
9
|
+
def one
|
10
|
+
1
|
11
|
+
end
|
12
|
+
end
|
13
|
+
module NamedExtension
|
14
|
+
def two
|
15
|
+
2
|
16
|
+
end
|
17
|
+
end
|
18
|
+
module MultipleExtensionOne
|
19
|
+
def extension_one
|
20
|
+
1
|
21
|
+
end
|
22
|
+
end
|
23
|
+
module MultipleExtensionTwo
|
24
|
+
def extension_two
|
25
|
+
2
|
26
|
+
end
|
27
|
+
end
|
28
|
+
named_scope :named_extension, :extend => NamedExtension
|
29
|
+
named_scope :multiple_extensions, :extend => [MultipleExtensionTwo, MultipleExtensionOne]
|
30
|
+
|
31
|
+
has_many :replies, :dependent => :destroy, :foreign_key => "parent_id"
|
32
|
+
serialize :content
|
33
|
+
|
34
|
+
before_create :default_written_on
|
35
|
+
before_destroy :destroy_children
|
36
|
+
|
37
|
+
def parent
|
38
|
+
Topic.find(parent_id)
|
39
|
+
end
|
40
|
+
|
41
|
+
# trivial method for testing Array#to_xml with :methods
|
42
|
+
def topic_id
|
43
|
+
id
|
44
|
+
end
|
45
|
+
|
46
|
+
protected
|
47
|
+
def approved=(val)
|
48
|
+
@custom_approved = val
|
49
|
+
write_attribute(:approved, val)
|
50
|
+
end
|
51
|
+
|
52
|
+
def default_written_on
|
53
|
+
self.written_on = Time.now unless attribute_present?("written_on")
|
54
|
+
end
|
55
|
+
|
56
|
+
def destroy_children
|
57
|
+
self.class.delete_all "parent_id = #{id}"
|
58
|
+
end
|
59
|
+
|
60
|
+
def after_initialize
|
61
|
+
if self.new_record?
|
62
|
+
self.author_email_address = 'test@test.com'
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# This class models a vertex in a directed graph.
|
2
|
+
class Vertex < ActiveRecord::Base
|
3
|
+
has_many :sink_edges, :class_name => 'Edge', :foreign_key => 'source_id'
|
4
|
+
has_many :sinks, :through => :sink_edges
|
5
|
+
|
6
|
+
has_and_belongs_to_many :sources,
|
7
|
+
:class_name => 'Vertex', :join_table => 'edges',
|
8
|
+
:foreign_key => 'sink_id', :association_foreign_key => 'source_id'
|
9
|
+
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# Don't change this file!
|
2
|
+
# Configure your app in config/environment.rb and config/environments/*.rb
|
3
|
+
|
4
|
+
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
|
5
|
+
|
6
|
+
module Rails
|
7
|
+
class << self
|
8
|
+
def boot!
|
9
|
+
unless booted?
|
10
|
+
preinitialize
|
11
|
+
pick_boot.run
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def booted?
|
16
|
+
defined? Rails::Initializer
|
17
|
+
end
|
18
|
+
|
19
|
+
def pick_boot
|
20
|
+
(vendor_rails? ? VendorBoot : GemBoot).new
|
21
|
+
end
|
22
|
+
|
23
|
+
def vendor_rails?
|
24
|
+
File.exist?("#{RAILS_ROOT}/vendor/rails")
|
25
|
+
end
|
26
|
+
|
27
|
+
def preinitialize
|
28
|
+
load(preinitializer_path) if File.exist?(preinitializer_path)
|
29
|
+
end
|
30
|
+
|
31
|
+
def preinitializer_path
|
32
|
+
"#{RAILS_ROOT}/config/preinitializer.rb"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class Boot
|
37
|
+
def run
|
38
|
+
load_initializer
|
39
|
+
Rails::Initializer.run(:set_load_path)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
class VendorBoot < Boot
|
44
|
+
def load_initializer
|
45
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
46
|
+
Rails::Initializer.run(:install_gem_spec_stubs)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
class GemBoot < Boot
|
51
|
+
def load_initializer
|
52
|
+
self.class.load_rubygems
|
53
|
+
load_rails_gem
|
54
|
+
require 'initializer'
|
55
|
+
end
|
56
|
+
|
57
|
+
def load_rails_gem
|
58
|
+
if version = self.class.gem_version
|
59
|
+
gem 'rails', version
|
60
|
+
else
|
61
|
+
gem 'rails'
|
62
|
+
end
|
63
|
+
rescue Gem::LoadError => load_error
|
64
|
+
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
|
65
|
+
exit 1
|
66
|
+
end
|
67
|
+
|
68
|
+
class << self
|
69
|
+
def rubygems_version
|
70
|
+
Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
|
71
|
+
end
|
72
|
+
|
73
|
+
def gem_version
|
74
|
+
if defined? RAILS_GEM_VERSION
|
75
|
+
RAILS_GEM_VERSION
|
76
|
+
elsif ENV.include?('RAILS_GEM_VERSION')
|
77
|
+
ENV['RAILS_GEM_VERSION']
|
78
|
+
else
|
79
|
+
parse_gem_version(read_environment_rb)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def load_rubygems
|
84
|
+
require 'rubygems'
|
85
|
+
|
86
|
+
unless rubygems_version >= '0.9.4'
|
87
|
+
$stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
88
|
+
exit 1
|
89
|
+
end
|
90
|
+
|
91
|
+
rescue LoadError
|
92
|
+
$stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
93
|
+
exit 1
|
94
|
+
end
|
95
|
+
|
96
|
+
def parse_gem_version(text)
|
97
|
+
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
|
98
|
+
end
|
99
|
+
|
100
|
+
private
|
101
|
+
def read_environment_rb
|
102
|
+
File.read("#{RAILS_ROOT}/config/environment.rb")
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
# All that for this:
|
109
|
+
Rails.boot!
|
@@ -0,0 +1,19 @@
|
|
1
|
+
RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
|
2
|
+
|
3
|
+
require File.join(File.dirname(__FILE__), 'boot')
|
4
|
+
|
5
|
+
require 'active_support'
|
6
|
+
include ActiveSupport::Cache
|
7
|
+
|
8
|
+
Rails::Initializer.run do |config|
|
9
|
+
config.log_level = :debug
|
10
|
+
config.cache_classes = false
|
11
|
+
config.whiny_nils = true
|
12
|
+
config.action_controller.perform_caching = true
|
13
|
+
config.cache_store = :mem_cache_store, { :servers => 'localhost:11211',
|
14
|
+
:namespace => 'testing_app',
|
15
|
+
:compression => true
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
require File.expand_path(File.dirname(__FILE__)) + "/../../../lib/query_memcached"
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format
|
4
|
+
# (all these examples are active by default):
|
5
|
+
# Inflector.inflections do |inflect|
|
6
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
+
# inflect.singular /^(ox)en/i, '\1'
|
8
|
+
# inflect.irregular 'person', 'people'
|
9
|
+
# inflect.uncountable %w( fish sheep )
|
10
|
+
# end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# These settings change the behavior of Rails 2 apps and will be defaults
|
2
|
+
# for Rails 3. You can remove this initializer when Rails 3 is released.
|
3
|
+
|
4
|
+
# Include Active Record class name as root for JSON serialized output.
|
5
|
+
ActiveRecord::Base.include_root_in_json = true
|
6
|
+
|
7
|
+
# Store the full class name (including module namespace) in STI type column.
|
8
|
+
ActiveRecord::Base.store_full_sti_class = true
|
9
|
+
|
10
|
+
# Use ISO 8601 format for JSON serialized times and dates.
|
11
|
+
ActiveSupport.use_standard_json_time_format = true
|
12
|
+
|
13
|
+
# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
|
14
|
+
# if you're including raw json in an HTML page.
|
15
|
+
ActiveSupport.escape_html_entities_in_json = false
|
@@ -0,0 +1,41 @@
|
|
1
|
+
ActionController::Routing::Routes.draw do |map|
|
2
|
+
# The priority is based upon order of creation: first created -> highest priority.
|
3
|
+
|
4
|
+
# Sample of regular route:
|
5
|
+
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
|
6
|
+
# Keep in mind you can assign values other than :controller and :action
|
7
|
+
|
8
|
+
# Sample of named route:
|
9
|
+
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
|
10
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
11
|
+
|
12
|
+
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
13
|
+
# map.resources :products
|
14
|
+
|
15
|
+
# Sample resource route with options:
|
16
|
+
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
|
17
|
+
|
18
|
+
# Sample resource route with sub-resources:
|
19
|
+
# map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
|
20
|
+
|
21
|
+
# Sample resource route with more complex sub-resources
|
22
|
+
# map.resources :products do |products|
|
23
|
+
# products.resources :comments
|
24
|
+
# products.resources :sales, :collection => { :recent => :get }
|
25
|
+
# end
|
26
|
+
|
27
|
+
# Sample resource route within a namespace:
|
28
|
+
# map.namespace :admin do |admin|
|
29
|
+
# # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
|
30
|
+
# admin.resources :products
|
31
|
+
# end
|
32
|
+
|
33
|
+
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
|
34
|
+
# map.root :controller => "welcome"
|
35
|
+
|
36
|
+
# See how all your routes lay out with "rake routes"
|
37
|
+
|
38
|
+
# Install the default routes as the lowest priority.
|
39
|
+
map.connect ':controller/:action/:id'
|
40
|
+
map.connect ':controller/:action/:id.:format'
|
41
|
+
end
|
@@ -0,0 +1,443 @@
|
|
1
|
+
# This file is auto-generated from the current state of the database. Instead of editing this file,
|
2
|
+
# please use the migrations feature of Active Record to incrementally modify your database, and
|
3
|
+
# then regenerate this schema definition.
|
4
|
+
#
|
5
|
+
# Note that this schema.rb definition is the authoritative source for your database schema. If you need
|
6
|
+
# to create the application database on another system, you should be using db:schema:load, not running
|
7
|
+
# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
8
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
9
|
+
#
|
10
|
+
# It's strongly recommended to check this file into your version control system.
|
11
|
+
|
12
|
+
ActiveRecord::Schema.define(:version => 0) do
|
13
|
+
|
14
|
+
create_table "accounts", :force => true do |t|
|
15
|
+
t.integer "firm_id", :limit => 11
|
16
|
+
t.integer "credit_limit", :limit => 11
|
17
|
+
end
|
18
|
+
|
19
|
+
create_table "audit_logs", :force => true do |t|
|
20
|
+
t.string "message", :null => false
|
21
|
+
t.integer "developer_id", :limit => 11, :null => false
|
22
|
+
end
|
23
|
+
|
24
|
+
create_table "author_addresses", :force => true do |t|
|
25
|
+
end
|
26
|
+
|
27
|
+
create_table "author_favorites", :force => true do |t|
|
28
|
+
t.integer "author_id", :limit => 11
|
29
|
+
t.integer "favorite_author_id", :limit => 11
|
30
|
+
end
|
31
|
+
|
32
|
+
create_table "authors", :force => true do |t|
|
33
|
+
t.string "name", :null => false
|
34
|
+
t.integer "author_address_id", :limit => 11
|
35
|
+
t.integer "author_address_extra_id", :limit => 11
|
36
|
+
end
|
37
|
+
|
38
|
+
create_table "auto_id_tests", :primary_key => "auto_id", :force => true do |t|
|
39
|
+
t.integer "value", :limit => 11
|
40
|
+
end
|
41
|
+
|
42
|
+
create_table "binaries", :force => true do |t|
|
43
|
+
t.binary "data"
|
44
|
+
end
|
45
|
+
|
46
|
+
create_table "binary_fields", :force => true do |t|
|
47
|
+
t.binary "tiny_blob", :limit => 255
|
48
|
+
t.binary "normal_blob"
|
49
|
+
t.binary "medium_blob", :limit => 16777215
|
50
|
+
t.binary "long_blob", :limit => 2147483647
|
51
|
+
t.text "tiny_text"
|
52
|
+
t.text "normal_text"
|
53
|
+
t.text "medium_text", :limit => 2147483647
|
54
|
+
t.text "long_text", :limit => 2147483647
|
55
|
+
end
|
56
|
+
|
57
|
+
create_table "books", :force => true do |t|
|
58
|
+
t.string "name"
|
59
|
+
end
|
60
|
+
|
61
|
+
create_table "booleantests", :force => true do |t|
|
62
|
+
t.boolean "value"
|
63
|
+
end
|
64
|
+
|
65
|
+
create_table "categories", :force => true do |t|
|
66
|
+
t.string "name", :null => false
|
67
|
+
t.string "type"
|
68
|
+
t.integer "categorizations_count", :limit => 11
|
69
|
+
end
|
70
|
+
|
71
|
+
create_table "categories_posts", :id => false, :force => true do |t|
|
72
|
+
t.integer "category_id", :limit => 11, :null => false
|
73
|
+
t.integer "post_id", :limit => 11, :null => false
|
74
|
+
end
|
75
|
+
|
76
|
+
create_table "categorizations", :force => true do |t|
|
77
|
+
t.integer "category_id", :limit => 11
|
78
|
+
t.integer "post_id", :limit => 11
|
79
|
+
t.integer "author_id", :limit => 11
|
80
|
+
end
|
81
|
+
|
82
|
+
create_table "circles", :force => true do |t|
|
83
|
+
end
|
84
|
+
|
85
|
+
create_table "citations", :force => true do |t|
|
86
|
+
t.integer "book1_id", :limit => 11
|
87
|
+
t.integer "book2_id", :limit => 11
|
88
|
+
end
|
89
|
+
|
90
|
+
create_table "clubs", :force => true do |t|
|
91
|
+
t.string "name"
|
92
|
+
end
|
93
|
+
|
94
|
+
create_table "colnametests", :force => true do |t|
|
95
|
+
t.integer "references", :limit => 11, :null => false
|
96
|
+
end
|
97
|
+
|
98
|
+
create_table "comments", :force => true do |t|
|
99
|
+
t.integer "post_id", :limit => 11, :null => false
|
100
|
+
t.text "body", :null => false
|
101
|
+
t.string "type"
|
102
|
+
end
|
103
|
+
|
104
|
+
create_table "companies", :force => true do |t|
|
105
|
+
t.string "type"
|
106
|
+
t.string "ruby_type"
|
107
|
+
t.integer "firm_id", :limit => 11
|
108
|
+
t.string "firm_name"
|
109
|
+
t.string "name"
|
110
|
+
t.integer "client_of", :limit => 11
|
111
|
+
t.integer "rating", :limit => 11, :default => 1
|
112
|
+
end
|
113
|
+
|
114
|
+
create_table "computers", :force => true do |t|
|
115
|
+
t.integer "developer", :limit => 11, :null => false
|
116
|
+
t.integer "extendedWarranty", :limit => 11, :null => false
|
117
|
+
end
|
118
|
+
|
119
|
+
create_table "courses", :force => true do |t|
|
120
|
+
t.string "name"
|
121
|
+
end
|
122
|
+
|
123
|
+
create_table "customers", :force => true do |t|
|
124
|
+
t.string "name"
|
125
|
+
t.integer "balance", :limit => 11, :default => 0
|
126
|
+
t.string "address_street"
|
127
|
+
t.string "address_city"
|
128
|
+
t.string "address_country"
|
129
|
+
t.string "gps_location"
|
130
|
+
end
|
131
|
+
|
132
|
+
create_table "developers", :force => true do |t|
|
133
|
+
t.string "name"
|
134
|
+
t.integer "salary", :limit => 11, :default => 70000
|
135
|
+
t.datetime "created_at"
|
136
|
+
t.datetime "updated_at"
|
137
|
+
end
|
138
|
+
|
139
|
+
create_table "developers_projects", :id => false, :force => true do |t|
|
140
|
+
t.integer "developer_id", :limit => 11, :null => false
|
141
|
+
t.integer "project_id", :limit => 11, :null => false
|
142
|
+
t.date "joined_on"
|
143
|
+
t.integer "access_level", :limit => 11, :default => 1
|
144
|
+
end
|
145
|
+
|
146
|
+
create_table "edges", :force => true do |t|
|
147
|
+
t.integer "source_id", :limit => 11, :null => false
|
148
|
+
t.integer "sink_id", :limit => 11, :null => false
|
149
|
+
end
|
150
|
+
|
151
|
+
add_index "edges", ["source_id", "sink_id"], :name => "unique_edge_index", :unique => true
|
152
|
+
|
153
|
+
create_table "entrants", :force => true do |t|
|
154
|
+
t.string "name", :null => false
|
155
|
+
t.integer "course_id", :limit => 11, :null => false
|
156
|
+
end
|
157
|
+
|
158
|
+
create_table "fk_test_has_fk", :force => true do |t|
|
159
|
+
t.integer "fk_id", :limit => 11, :null => false
|
160
|
+
end
|
161
|
+
|
162
|
+
add_index "fk_test_has_fk", ["fk_id"], :name => "fk_name"
|
163
|
+
|
164
|
+
create_table "fk_test_has_pk", :force => true do |t|
|
165
|
+
end
|
166
|
+
|
167
|
+
create_table "funny_jokes", :force => true do |t|
|
168
|
+
t.string "name"
|
169
|
+
end
|
170
|
+
|
171
|
+
create_table "guids", :force => true do |t|
|
172
|
+
t.string "key"
|
173
|
+
end
|
174
|
+
|
175
|
+
create_table "inept_wizards", :force => true do |t|
|
176
|
+
t.string "name", :null => false
|
177
|
+
t.string "city", :null => false
|
178
|
+
t.string "type"
|
179
|
+
end
|
180
|
+
|
181
|
+
create_table "integer_limits", :force => true do |t|
|
182
|
+
t.integer "c_int_without_limit", :limit => 11
|
183
|
+
t.integer "c_int_1", :limit => 11
|
184
|
+
t.integer "c_int_2", :limit => 20
|
185
|
+
t.integer "c_int_3", :limit => 11
|
186
|
+
t.integer "c_int_4", :limit => 11
|
187
|
+
t.integer "c_int_5", :limit => 11
|
188
|
+
t.integer "c_int_6", :limit => 11
|
189
|
+
t.integer "c_int_7", :limit => 11
|
190
|
+
t.integer "c_int_8", :limit => 11
|
191
|
+
end
|
192
|
+
|
193
|
+
create_table "items", :force => true do |t|
|
194
|
+
t.integer "name", :limit => 11
|
195
|
+
end
|
196
|
+
|
197
|
+
create_table "jobs", :force => true do |t|
|
198
|
+
t.integer "ideal_reference_id", :limit => 11
|
199
|
+
end
|
200
|
+
|
201
|
+
create_table "keyboards", :primary_key => "key_number", :force => true do |t|
|
202
|
+
t.string "name"
|
203
|
+
end
|
204
|
+
|
205
|
+
create_table "legacy_things", :force => true do |t|
|
206
|
+
t.integer "tps_report_number", :limit => 11
|
207
|
+
t.integer "version", :limit => 11, :default => 0, :null => false
|
208
|
+
end
|
209
|
+
|
210
|
+
create_table "lock_without_defaults", :force => true do |t|
|
211
|
+
t.integer "lock_version", :limit => 11
|
212
|
+
end
|
213
|
+
|
214
|
+
create_table "lock_without_defaults_cust", :force => true do |t|
|
215
|
+
t.integer "custom_lock_version", :limit => 11
|
216
|
+
end
|
217
|
+
|
218
|
+
create_table "mateys", :id => false, :force => true do |t|
|
219
|
+
t.integer "pirate_id", :limit => 11
|
220
|
+
t.integer "target_id", :limit => 11
|
221
|
+
t.integer "weight", :limit => 11
|
222
|
+
end
|
223
|
+
|
224
|
+
create_table "members", :force => true do |t|
|
225
|
+
t.string "name"
|
226
|
+
end
|
227
|
+
|
228
|
+
create_table "memberships", :force => true do |t|
|
229
|
+
t.datetime "joined_on"
|
230
|
+
t.integer "club_id", :limit => 11
|
231
|
+
t.integer "member_id", :limit => 11
|
232
|
+
t.boolean "favourite", :default => false
|
233
|
+
t.string "type"
|
234
|
+
end
|
235
|
+
|
236
|
+
create_table "minimalistics", :force => true do |t|
|
237
|
+
end
|
238
|
+
|
239
|
+
create_table "mixed_case_monkeys", :primary_key => "monkeyID", :force => true do |t|
|
240
|
+
t.integer "fleaCount", :limit => 11
|
241
|
+
end
|
242
|
+
|
243
|
+
create_table "mixins", :force => true do |t|
|
244
|
+
t.integer "parent_id", :limit => 11
|
245
|
+
t.integer "pos", :limit => 11
|
246
|
+
t.datetime "created_at"
|
247
|
+
t.datetime "updated_at"
|
248
|
+
t.integer "lft", :limit => 11
|
249
|
+
t.integer "rgt", :limit => 11
|
250
|
+
t.integer "root_id", :limit => 11
|
251
|
+
t.string "type"
|
252
|
+
end
|
253
|
+
|
254
|
+
create_table "movies", :primary_key => "movieid", :force => true do |t|
|
255
|
+
t.string "name"
|
256
|
+
end
|
257
|
+
|
258
|
+
create_table "non_poly_ones", :force => true do |t|
|
259
|
+
end
|
260
|
+
|
261
|
+
create_table "non_poly_twos", :force => true do |t|
|
262
|
+
end
|
263
|
+
|
264
|
+
create_table "numeric_data", :force => true do |t|
|
265
|
+
t.decimal "bank_balance", :precision => 10, :scale => 2
|
266
|
+
t.decimal "big_bank_balance", :precision => 15, :scale => 2
|
267
|
+
t.integer "world_population", :limit => 11
|
268
|
+
t.integer "my_house_population", :limit => 6
|
269
|
+
t.decimal "decimal_number_with_default", :precision => 3, :scale => 2, :default => 2.78
|
270
|
+
end
|
271
|
+
|
272
|
+
create_table "orders", :force => true do |t|
|
273
|
+
t.string "name"
|
274
|
+
t.integer "billing_customer_id", :limit => 11
|
275
|
+
t.integer "shipping_customer_id", :limit => 11
|
276
|
+
end
|
277
|
+
|
278
|
+
create_table "owners", :primary_key => "owner_id", :force => true do |t|
|
279
|
+
t.string "name"
|
280
|
+
end
|
281
|
+
|
282
|
+
create_table "paint_colors", :force => true do |t|
|
283
|
+
t.integer "non_poly_one_id", :limit => 11
|
284
|
+
end
|
285
|
+
|
286
|
+
create_table "paint_textures", :force => true do |t|
|
287
|
+
t.integer "non_poly_two_id", :limit => 11
|
288
|
+
end
|
289
|
+
|
290
|
+
create_table "parrots", :force => true do |t|
|
291
|
+
t.string "name"
|
292
|
+
t.string "parrot_sti_class"
|
293
|
+
t.integer "killer_id", :limit => 11
|
294
|
+
t.datetime "created_at"
|
295
|
+
t.datetime "created_on"
|
296
|
+
t.datetime "updated_at"
|
297
|
+
t.datetime "updated_on"
|
298
|
+
end
|
299
|
+
|
300
|
+
create_table "parrots_pirates", :id => false, :force => true do |t|
|
301
|
+
t.integer "parrot_id", :limit => 11
|
302
|
+
t.integer "pirate_id", :limit => 11
|
303
|
+
end
|
304
|
+
|
305
|
+
create_table "parrots_treasures", :id => false, :force => true do |t|
|
306
|
+
t.integer "parrot_id", :limit => 11
|
307
|
+
t.integer "treasure_id", :limit => 11
|
308
|
+
end
|
309
|
+
|
310
|
+
create_table "people", :force => true do |t|
|
311
|
+
t.integer "lock_version", :limit => 11, :default => 0, :null => false
|
312
|
+
t.string "first_name", :limit => 40
|
313
|
+
end
|
314
|
+
|
315
|
+
create_table "pets", :primary_key => "pet_id", :force => true do |t|
|
316
|
+
t.string "name"
|
317
|
+
t.integer "owner_id", :limit => 11
|
318
|
+
t.integer "integer", :limit => 11
|
319
|
+
end
|
320
|
+
|
321
|
+
create_table "pirates", :force => true do |t|
|
322
|
+
t.string "catchphrase"
|
323
|
+
t.integer "parrot_id", :limit => 11
|
324
|
+
t.datetime "created_on"
|
325
|
+
t.datetime "updated_on"
|
326
|
+
end
|
327
|
+
|
328
|
+
create_table "posts", :force => true do |t|
|
329
|
+
t.integer "author_id", :limit => 11
|
330
|
+
t.string "title", :null => false
|
331
|
+
t.text "body", :null => false
|
332
|
+
t.string "type"
|
333
|
+
t.integer "comments_count", :limit => 11, :default => 0
|
334
|
+
t.integer "taggings_count", :limit => 11, :default => 0
|
335
|
+
end
|
336
|
+
|
337
|
+
create_table "price_estimates", :force => true do |t|
|
338
|
+
t.string "estimate_of_type"
|
339
|
+
t.integer "estimate_of_id", :limit => 11
|
340
|
+
t.integer "price", :limit => 11
|
341
|
+
end
|
342
|
+
|
343
|
+
create_table "projects", :force => true do |t|
|
344
|
+
t.string "name"
|
345
|
+
t.string "type"
|
346
|
+
end
|
347
|
+
|
348
|
+
create_table "readers", :force => true do |t|
|
349
|
+
t.integer "post_id", :limit => 11, :null => false
|
350
|
+
t.integer "person_id", :limit => 11, :null => false
|
351
|
+
end
|
352
|
+
|
353
|
+
create_table "references", :force => true do |t|
|
354
|
+
t.integer "person_id", :limit => 11
|
355
|
+
t.integer "job_id", :limit => 11
|
356
|
+
t.boolean "favourite"
|
357
|
+
t.integer "lock_version", :limit => 11, :default => 0
|
358
|
+
end
|
359
|
+
|
360
|
+
create_table "shape_expressions", :force => true do |t|
|
361
|
+
t.string "paint_type"
|
362
|
+
t.integer "paint_id", :limit => 11
|
363
|
+
t.string "shape_type"
|
364
|
+
t.integer "shape_id", :limit => 11
|
365
|
+
end
|
366
|
+
|
367
|
+
create_table "ships", :force => true do |t|
|
368
|
+
t.string "name"
|
369
|
+
t.datetime "created_at"
|
370
|
+
t.datetime "created_on"
|
371
|
+
t.datetime "updated_at"
|
372
|
+
t.datetime "updated_on"
|
373
|
+
end
|
374
|
+
|
375
|
+
create_table "sponsors", :force => true do |t|
|
376
|
+
t.integer "club_id", :limit => 11
|
377
|
+
t.integer "sponsorable_id", :limit => 11
|
378
|
+
t.string "sponsorable_type"
|
379
|
+
end
|
380
|
+
|
381
|
+
create_table "squares", :force => true do |t|
|
382
|
+
end
|
383
|
+
|
384
|
+
create_table "subscribers", :primary_key => "nick", :force => true do |t|
|
385
|
+
t.string "name"
|
386
|
+
end
|
387
|
+
|
388
|
+
add_index "subscribers", ["nick"], :name => "index_subscribers_on_nick", :unique => true
|
389
|
+
|
390
|
+
create_table "subscriptions", :force => true do |t|
|
391
|
+
t.string "subscriber_id"
|
392
|
+
t.integer "book_id", :limit => 11
|
393
|
+
end
|
394
|
+
|
395
|
+
create_table "taggings", :force => true do |t|
|
396
|
+
t.integer "tag_id", :limit => 11
|
397
|
+
t.integer "super_tag_id", :limit => 11
|
398
|
+
t.string "taggable_type"
|
399
|
+
t.integer "taggable_id", :limit => 11
|
400
|
+
end
|
401
|
+
|
402
|
+
create_table "tags", :force => true do |t|
|
403
|
+
t.string "name"
|
404
|
+
t.integer "taggings_count", :limit => 11, :default => 0
|
405
|
+
end
|
406
|
+
|
407
|
+
create_table "tasks", :force => true do |t|
|
408
|
+
t.datetime "starting"
|
409
|
+
t.datetime "ending"
|
410
|
+
end
|
411
|
+
|
412
|
+
create_table "topics", :force => true do |t|
|
413
|
+
t.string "title"
|
414
|
+
t.string "author_name"
|
415
|
+
t.string "author_email_address"
|
416
|
+
t.datetime "written_on", :null => false
|
417
|
+
t.time "bonus_time"
|
418
|
+
t.date "last_read"
|
419
|
+
t.text "content"
|
420
|
+
t.boolean "approved", :default => true
|
421
|
+
t.integer "replies_count", :limit => 11, :default => 0
|
422
|
+
t.integer "parent_id", :limit => 11
|
423
|
+
t.string "type"
|
424
|
+
end
|
425
|
+
|
426
|
+
create_table "treasures", :force => true do |t|
|
427
|
+
t.string "name"
|
428
|
+
t.integer "looter_id", :limit => 11
|
429
|
+
t.string "looter_type"
|
430
|
+
end
|
431
|
+
|
432
|
+
create_table "triangles", :force => true do |t|
|
433
|
+
end
|
434
|
+
|
435
|
+
create_table "vertices", :force => true do |t|
|
436
|
+
t.string "label"
|
437
|
+
end
|
438
|
+
|
439
|
+
create_table "warehouse-things", :force => true do |t|
|
440
|
+
t.integer "value", :limit => 11
|
441
|
+
end
|
442
|
+
|
443
|
+
end
|