rails3_pg_deferred_constraints 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -0
- data/Rakefile +1 -10
- data/lib/rails3_pg_deferred_constraints/fixtures.rb +1 -1
- data/lib/rails3_pg_deferred_constraints/version.rb +1 -1
- data/test/dummy/Gemfile +1 -1
- data/test/dummy/Gemfile.lock +49 -51
- data/test/dummy/config/application.rb +20 -3
- data/test/dummy/config/boot.rb +2 -4
- data/test/dummy/config/database.yml +14 -16
- data/test/dummy/config/environments/development.rb +8 -1
- data/test/dummy/config/environments/production.rb +8 -1
- data/test/dummy/config/environments/test.rb +4 -9
- data/test/dummy/config/initializers/inflections.rb +5 -0
- data/test/dummy/config/routes.rb +1 -1
- data/test/dummy/log/development.log +22 -167
- data/test/dummy/log/test.log +232 -1076
- data/test/dummy/test/performance/browsing_test.rb +1 -1
- data/test/dummy/test/unit/book_test.rb +1 -4
- data/test/dummy/test/unit/user_test.rb +1 -1
- data/test/rails3_pg_deferred_constraints_test.rb +8 -9
- metadata +77 -85
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/test_helper.rb +0 -10
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -1,9 +1,5 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
|
-
|
3
|
-
require 'bundler/setup'
|
4
|
-
rescue LoadError
|
5
|
-
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
-
end
|
2
|
+
|
7
3
|
begin
|
8
4
|
require 'rdoc/task'
|
9
5
|
rescue LoadError
|
@@ -20,10 +16,6 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
20
16
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
17
|
end
|
22
18
|
|
23
|
-
|
24
|
-
|
25
|
-
Bundler::GemHelper.install_tasks
|
26
|
-
|
27
19
|
require 'rake/testtask'
|
28
20
|
|
29
21
|
Rake::TestTask.new(:test) do |t|
|
@@ -32,5 +24,4 @@ Rake::TestTask.new(:test) do |t|
|
|
32
24
|
t.verbose = false
|
33
25
|
end
|
34
26
|
|
35
|
-
|
36
27
|
task :default => :test
|
data/test/dummy/Gemfile
CHANGED
data/test/dummy/Gemfile.lock
CHANGED
@@ -1,87 +1,85 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
actionmailer (3.1
|
5
|
-
actionpack (= 3.1
|
6
|
-
mail (~> 2.
|
7
|
-
actionpack (3.1
|
8
|
-
activemodel (= 3.1
|
9
|
-
activesupport (= 3.1
|
4
|
+
actionmailer (3.2.1)
|
5
|
+
actionpack (= 3.2.1)
|
6
|
+
mail (~> 2.4.0)
|
7
|
+
actionpack (3.2.1)
|
8
|
+
activemodel (= 3.2.1)
|
9
|
+
activesupport (= 3.2.1)
|
10
10
|
builder (~> 3.0.0)
|
11
11
|
erubis (~> 2.7.0)
|
12
|
-
|
13
|
-
rack (~> 1.
|
14
|
-
rack-cache (~> 1.
|
15
|
-
rack-mount (~> 0.8.2)
|
12
|
+
journey (~> 1.0.1)
|
13
|
+
rack (~> 1.4.0)
|
14
|
+
rack-cache (~> 1.1)
|
16
15
|
rack-test (~> 0.6.1)
|
17
|
-
sprockets (~> 2.
|
18
|
-
activemodel (3.1
|
19
|
-
activesupport (= 3.1
|
20
|
-
bcrypt-ruby (~> 3.0.0)
|
16
|
+
sprockets (~> 2.1.2)
|
17
|
+
activemodel (3.2.1)
|
18
|
+
activesupport (= 3.2.1)
|
21
19
|
builder (~> 3.0.0)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
arel (~> 2.2.1)
|
20
|
+
activerecord (3.2.1)
|
21
|
+
activemodel (= 3.2.1)
|
22
|
+
activesupport (= 3.2.1)
|
23
|
+
arel (~> 3.0.0)
|
27
24
|
tzinfo (~> 0.3.29)
|
28
|
-
activeresource (3.1
|
29
|
-
activemodel (= 3.1
|
30
|
-
activesupport (= 3.1
|
31
|
-
activesupport (3.1
|
25
|
+
activeresource (3.2.1)
|
26
|
+
activemodel (= 3.2.1)
|
27
|
+
activesupport (= 3.2.1)
|
28
|
+
activesupport (3.2.1)
|
29
|
+
i18n (~> 0.6)
|
32
30
|
multi_json (~> 1.0)
|
33
|
-
arel (
|
34
|
-
bcrypt-ruby (3.0.0)
|
31
|
+
arel (3.0.0)
|
35
32
|
builder (3.0.0)
|
36
33
|
erubis (2.7.0)
|
37
|
-
foreigner (1.1.
|
34
|
+
foreigner (1.1.2)
|
38
35
|
activerecord (>= 3.0.0)
|
39
36
|
hike (1.2.1)
|
40
37
|
i18n (0.6.0)
|
41
|
-
|
38
|
+
journey (1.0.1)
|
39
|
+
json (1.6.5)
|
40
|
+
mail (2.4.1)
|
42
41
|
i18n (>= 0.4.0)
|
43
42
|
mime-types (~> 1.16)
|
44
43
|
treetop (~> 1.4.8)
|
45
|
-
mime-types (1.
|
46
|
-
multi_json (1.0.
|
47
|
-
pg (0.
|
48
|
-
polyglot (0.3.
|
49
|
-
rack (1.
|
50
|
-
rack-cache (1.
|
44
|
+
mime-types (1.17.2)
|
45
|
+
multi_json (1.0.4)
|
46
|
+
pg (0.13.1)
|
47
|
+
polyglot (0.3.3)
|
48
|
+
rack (1.4.1)
|
49
|
+
rack-cache (1.1)
|
51
50
|
rack (>= 0.4)
|
52
|
-
rack-mount (0.8.3)
|
53
|
-
rack (>= 1.0.0)
|
54
51
|
rack-ssl (1.3.2)
|
55
52
|
rack
|
56
53
|
rack-test (0.6.1)
|
57
54
|
rack (>= 1.0)
|
58
|
-
rails (3.1
|
59
|
-
actionmailer (= 3.1
|
60
|
-
actionpack (= 3.1
|
61
|
-
activerecord (= 3.1
|
62
|
-
activeresource (= 3.1
|
63
|
-
activesupport (= 3.1
|
55
|
+
rails (3.2.1)
|
56
|
+
actionmailer (= 3.2.1)
|
57
|
+
actionpack (= 3.2.1)
|
58
|
+
activerecord (= 3.2.1)
|
59
|
+
activeresource (= 3.2.1)
|
60
|
+
activesupport (= 3.2.1)
|
64
61
|
bundler (~> 1.0)
|
65
|
-
railties (= 3.1
|
66
|
-
railties (3.1
|
67
|
-
actionpack (= 3.1
|
68
|
-
activesupport (= 3.1
|
62
|
+
railties (= 3.2.1)
|
63
|
+
railties (3.2.1)
|
64
|
+
actionpack (= 3.2.1)
|
65
|
+
activesupport (= 3.2.1)
|
69
66
|
rack-ssl (~> 1.3.2)
|
70
67
|
rake (>= 0.8.7)
|
71
68
|
rdoc (~> 3.4)
|
72
69
|
thor (~> 0.14.6)
|
73
|
-
rake (0.9.2)
|
74
|
-
rdoc (3.
|
75
|
-
|
70
|
+
rake (0.9.2.2)
|
71
|
+
rdoc (3.12)
|
72
|
+
json (~> 1.4)
|
73
|
+
sprockets (2.1.2)
|
76
74
|
hike (~> 1.2)
|
77
75
|
rack (~> 1.0)
|
78
|
-
tilt (
|
76
|
+
tilt (~> 1.1, != 1.3.0)
|
79
77
|
thor (0.14.6)
|
80
78
|
tilt (1.3.3)
|
81
79
|
treetop (1.4.10)
|
82
80
|
polyglot
|
83
81
|
polyglot (>= 0.3.1)
|
84
|
-
tzinfo (0.3.
|
82
|
+
tzinfo (0.3.31)
|
85
83
|
|
86
84
|
PLATFORMS
|
87
85
|
ruby
|
@@ -89,4 +87,4 @@ PLATFORMS
|
|
89
87
|
DEPENDENCIES
|
90
88
|
foreigner
|
91
89
|
pg
|
92
|
-
rails
|
90
|
+
rails (~> 3.2.0)
|
@@ -2,9 +2,16 @@ require File.expand_path('../boot', __FILE__)
|
|
2
2
|
|
3
3
|
require 'rails/all'
|
4
4
|
|
5
|
-
|
5
|
+
if ENV['PG_DEFERRED_CONSTRAINTS'] == 'true'
|
6
|
+
require File.expand_path(File.join('..', '..', '..', '..', 'lib', 'rails3_pg_deferred_constraints'), __FILE__)
|
7
|
+
end
|
6
8
|
|
7
|
-
|
9
|
+
if defined?(Bundler)
|
10
|
+
# If you precompile assets before deploying to production, use this line
|
11
|
+
Bundler.require(*Rails.groups(:assets => %w(development test)))
|
12
|
+
# If you want your assets lazily compiled in production, use this line
|
13
|
+
# Bundler.require(:default, :assets, Rails.env)
|
14
|
+
end
|
8
15
|
|
9
16
|
module Dummy
|
10
17
|
class Application < Rails::Application
|
@@ -36,6 +43,17 @@ module Dummy
|
|
36
43
|
# Configure sensitive parameters which will be filtered from the log file.
|
37
44
|
config.filter_parameters += [:password]
|
38
45
|
|
46
|
+
# Use SQL instead of Active Record's schema dumper when creating the database.
|
47
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
48
|
+
# like if you have constraints or database-specific column types
|
49
|
+
# config.active_record.schema_format = :sql
|
50
|
+
|
51
|
+
# Enforce whitelist mode for mass assignment.
|
52
|
+
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
53
|
+
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
54
|
+
# parameters by using an attr_accessible or attr_protected declaration.
|
55
|
+
# config.active_record.whitelist_attributes = true
|
56
|
+
|
39
57
|
# Enable the asset pipeline
|
40
58
|
config.assets.enabled = true
|
41
59
|
|
@@ -43,4 +61,3 @@ module Dummy
|
|
43
61
|
config.assets.version = '1.0'
|
44
62
|
end
|
45
63
|
end
|
46
|
-
|
data/test/dummy/config/boot.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
|
3
3
|
# Set up gems listed in the Gemfile.
|
4
|
-
ENV['BUNDLE_GEMFILE']
|
5
|
-
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
|
6
|
-
|
4
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
7
5
|
|
8
|
-
|
6
|
+
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
|
@@ -1,28 +1,26 @@
|
|
1
|
-
# SQLite version 3.x
|
2
|
-
# gem install sqlite3
|
3
|
-
#
|
4
|
-
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
-
# gem 'sqlite3'
|
6
1
|
development:
|
7
2
|
adapter: postgresql
|
8
3
|
encoding: unicode
|
9
|
-
database:
|
4
|
+
database: autocash_rails3_pg_deferred_constraints_development
|
10
5
|
pool: 5
|
11
|
-
|
12
|
-
port: 5432
|
13
|
-
username: rails_bug
|
6
|
+
username: postgres
|
14
7
|
password: secret
|
8
|
+
host: localhost
|
15
9
|
|
16
|
-
|
17
|
-
# Warning: The database defined as "test" will be erased and
|
18
|
-
# re-generated from your development database when you run "rake".
|
19
|
-
# Do not set this db to the same as development or production.
|
20
10
|
test:
|
21
11
|
adapter: postgresql
|
22
12
|
encoding: unicode
|
23
|
-
database:
|
13
|
+
database: autocash_rails3_pg_deferred_constraints_test
|
24
14
|
pool: 5
|
15
|
+
username: postgres
|
16
|
+
password: secret
|
25
17
|
host: localhost
|
26
|
-
|
27
|
-
|
18
|
+
|
19
|
+
production:
|
20
|
+
adapter: postgresql
|
21
|
+
encoding: unicode
|
22
|
+
database: autocash_rails3_pg_deferred_constraints_production
|
23
|
+
pool: 5
|
24
|
+
username: postgres
|
28
25
|
password: secret
|
26
|
+
host: localhost
|
@@ -2,7 +2,7 @@ Dummy::Application.configure do
|
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb
|
3
3
|
|
4
4
|
# In the development environment your application's code is reloaded on
|
5
|
-
# every request.
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
6
|
# since you don't have to restart the web server when you make code changes.
|
7
7
|
config.cache_classes = false
|
8
8
|
|
@@ -22,6 +22,13 @@ Dummy::Application.configure do
|
|
22
22
|
# Only use best-standards-support built into browsers
|
23
23
|
config.action_dispatch.best_standards_support = :builtin
|
24
24
|
|
25
|
+
# Raise exception on mass assignment protection for Active Record models
|
26
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
27
|
+
|
28
|
+
# Log the query plan for queries taking more than this (works
|
29
|
+
# with SQLite, MySQL, and PostgreSQL)
|
30
|
+
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
31
|
+
|
25
32
|
# Do not compress assets
|
26
33
|
config.assets.compress = false
|
27
34
|
|
@@ -33,8 +33,11 @@ Dummy::Application.configure do
|
|
33
33
|
# See everything in the log (default is :info)
|
34
34
|
# config.log_level = :debug
|
35
35
|
|
36
|
+
# Prepend all log lines with the following tags
|
37
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
38
|
+
|
36
39
|
# Use a different logger for distributed setups
|
37
|
-
# config.logger = SyslogLogger.new
|
40
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
38
41
|
|
39
42
|
# Use a different cache store in production
|
40
43
|
# config.cache_store = :mem_cache_store
|
@@ -57,4 +60,8 @@ Dummy::Application.configure do
|
|
57
60
|
|
58
61
|
# Send deprecation notices to registered listeners
|
59
62
|
config.active_support.deprecation = :notify
|
63
|
+
|
64
|
+
# Log the query plan for queries taking more than this (works
|
65
|
+
# with SQLite, MySQL, and PostgreSQL)
|
66
|
+
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
60
67
|
end
|
@@ -2,9 +2,9 @@ Dummy::Application.configure do
|
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb
|
3
3
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
5
|
-
# test suite.
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
6
|
# your test database is "scratch space" for the test suite and is wiped
|
7
|
-
# and recreated between test runs.
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
8
|
config.cache_classes = true
|
9
9
|
|
10
10
|
# Configure static asset server for tests with Cache-Control for performance
|
@@ -29,14 +29,9 @@ Dummy::Application.configure do
|
|
29
29
|
# ActionMailer::Base.deliveries array.
|
30
30
|
config.action_mailer.delivery_method = :test
|
31
31
|
|
32
|
-
#
|
33
|
-
|
34
|
-
# like if you have constraints or database-specific column types
|
35
|
-
# config.active_record.schema_format = :sql
|
32
|
+
# Raise exception on mass assignment protection for Active Record models
|
33
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
36
34
|
|
37
35
|
# Print deprecation notices to the stderr
|
38
36
|
config.active_support.deprecation = :stderr
|
39
|
-
|
40
|
-
# Allow pass debug_assets=true as a query parameter to load pages with unpackaged assets
|
41
|
-
config.assets.allow_debugging = true
|
42
37
|
end
|
data/test/dummy/config/routes.rb
CHANGED
@@ -54,5 +54,5 @@ Dummy::Application.routes.draw do
|
|
54
54
|
|
55
55
|
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
56
56
|
# Note: This route will make all actions in every controller accessible via GET requests.
|
57
|
-
# match ':controller(/:action(/:id(.:format)
|
57
|
+
# match ':controller(/:action(/:id))(.:format)'
|
58
58
|
end
|
@@ -1,74 +1,35 @@
|
|
1
|
-
[1m[36m (
|
2
|
-
[1m[35m (0.
|
3
|
-
[1m[36m (
|
4
|
-
[1m[35m (0.1ms)[0m SET search_path TO public
|
5
|
-
[1m[36m (0.2ms)[0m [1mCREATE DATABASE "tmp_fix_test" ENCODING = 'unicode'[0m
|
6
|
-
PGError: ERROR: permission denied to create database
|
7
|
-
: CREATE DATABASE "tmp_fix_test" ENCODING = 'unicode'
|
8
|
-
[1m[36m (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
9
|
-
[1m[35m (0.1ms)[0m SET search_path TO public
|
10
|
-
[1m[36m (245.4ms)[0m [1mDROP DATABASE IF EXISTS "tmp_fix_test"[0m
|
11
|
-
[1m[35m (0.1ms)[0m SET search_path TO public
|
12
|
-
[1m[36m (0.2ms)[0m [1mCREATE DATABASE "tmp_fix_test" ENCODING = 'unicode'[0m
|
13
|
-
PGError: ERROR: permission denied to create database
|
14
|
-
: CREATE DATABASE "tmp_fix_test" ENCODING = 'unicode'
|
15
|
-
[1m[36m (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
16
|
-
Migrating to CreateUsers (20110908165659)
|
17
|
-
Migrating to CreateBooks (20110908165716)
|
18
|
-
Migrating to AddReferences (20110909072642)
|
19
|
-
[1m[35m (0.2ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
20
|
-
[1m[36m (0.1ms)[0m [1mSHOW search_path[0m
|
21
|
-
[1m[35m (1.5ms)[0m SELECT distinct i.relname, d.indisunique, d.indkey, t.oid
|
22
|
-
FROM pg_class t
|
23
|
-
INNER JOIN pg_index d ON t.oid = d.indrelid
|
24
|
-
INNER JOIN pg_class i ON d.indexrelid = i.oid
|
25
|
-
WHERE i.relkind = 'i'
|
26
|
-
AND d.indisprimary = 'f'
|
27
|
-
AND t.relname = 'books'
|
28
|
-
AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname IN ('"$user"','public') )
|
29
|
-
ORDER BY i.relname
|
30
|
-
[1m[36m (0.8ms)[0m [1m SELECT distinct i.relname, d.indisunique, d.indkey, t.oid
|
1
|
+
[1m[36m (29.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) [0m
|
2
|
+
[1m[35m (0.7ms)[0m SHOW search_path
|
3
|
+
[1m[36m (11.6ms)[0m [1m SELECT distinct i.relname, d.indisunique, d.indkey, t.oid
|
31
4
|
FROM pg_class t
|
32
5
|
INNER JOIN pg_index d ON t.oid = d.indrelid
|
33
6
|
INNER JOIN pg_class i ON d.indexrelid = i.oid
|
34
7
|
WHERE i.relkind = 'i'
|
35
8
|
AND d.indisprimary = 'f'
|
36
|
-
AND t.relname = '
|
37
|
-
AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname IN ('"$user"','public') )
|
38
|
-
ORDER BY i.relname
|
39
|
-
[0m
|
40
|
-
[1m[36m (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
41
|
-
Migrating to CreateUsers (20110908165659)
|
42
|
-
Migrating to CreateBooks (20110908165716)
|
43
|
-
Migrating to AddReferences (20110909072642)
|
44
|
-
[1m[35m (0.2ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
45
|
-
[1m[36m (0.1ms)[0m [1mSHOW search_path[0m
|
46
|
-
[1m[35m (2.3ms)[0m SELECT distinct i.relname, d.indisunique, d.indkey, t.oid
|
47
|
-
FROM pg_class t
|
48
|
-
INNER JOIN pg_index d ON t.oid = d.indrelid
|
49
|
-
INNER JOIN pg_class i ON d.indexrelid = i.oid
|
50
|
-
WHERE i.relkind = 'i'
|
51
|
-
AND d.indisprimary = 'f'
|
52
|
-
AND t.relname = 'books'
|
53
|
-
AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname IN ('"$user"','public') )
|
54
|
-
ORDER BY i.relname
|
55
|
-
[1m[36m (0.8ms)[0m [1m SELECT distinct i.relname, d.indisunique, d.indkey, t.oid
|
56
|
-
FROM pg_class t
|
57
|
-
INNER JOIN pg_index d ON t.oid = d.indrelid
|
58
|
-
INNER JOIN pg_class i ON d.indexrelid = i.oid
|
59
|
-
WHERE i.relkind = 'i'
|
60
|
-
AND d.indisprimary = 'f'
|
61
|
-
AND t.relname = 'users'
|
9
|
+
AND t.relname = 'schema_migrations'
|
62
10
|
AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname IN ('"$user"','public') )
|
63
11
|
ORDER BY i.relname
|
64
12
|
[0m
|
65
|
-
[1m[
|
13
|
+
[1m[35m (61.5ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
14
|
+
[1m[36m (1.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
66
15
|
Migrating to CreateUsers (20110908165659)
|
16
|
+
[1m[35m (0.6ms)[0m BEGIN
|
17
|
+
[1m[36m (45.9ms)[0m [1mCREATE TABLE "users" ("id" serial primary key, "name" character varying(255), "created_at" timestamp, "updated_at" timestamp) [0m
|
18
|
+
[1m[35m (0.7ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20110908165659')
|
19
|
+
[1m[36m (13.0ms)[0m [1mCOMMIT[0m
|
67
20
|
Migrating to CreateBooks (20110908165716)
|
21
|
+
[1m[35m (0.5ms)[0m BEGIN
|
22
|
+
[1m[36m (31.2ms)[0m [1mCREATE TABLE "books" ("id" serial primary key, "name" character varying(255), "user_id" integer, "created_at" timestamp, "updated_at" timestamp) [0m
|
23
|
+
[1m[35m (1.8ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20110908165716')
|
24
|
+
[1m[36m (9.0ms)[0m [1mCOMMIT[0m
|
68
25
|
Migrating to AddReferences (20110909072642)
|
69
|
-
[1m[35m (0.
|
26
|
+
[1m[35m (0.6ms)[0m BEGIN
|
27
|
+
[1m[36m (22.1ms)[0m [1mALTER TABLE "books" ADD CONSTRAINT "books_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"(id)[0m
|
28
|
+
[1m[35m (0.7ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20110909072642')
|
29
|
+
[1m[36m (10.7ms)[0m [1mCOMMIT[0m
|
30
|
+
[1m[35m (1.2ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
70
31
|
[1m[36m (0.2ms)[0m [1mSHOW search_path[0m
|
71
|
-
[1m[35m (1.
|
32
|
+
[1m[35m (1.5ms)[0m SELECT distinct i.relname, d.indisunique, d.indkey, t.oid
|
72
33
|
FROM pg_class t
|
73
34
|
INNER JOIN pg_index d ON t.oid = d.indrelid
|
74
35
|
INNER JOIN pg_class i ON d.indexrelid = i.oid
|
@@ -87,113 +48,7 @@ Migrating to AddReferences (20110909072642)
|
|
87
48
|
AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname IN ('"$user"','public') )
|
88
49
|
ORDER BY i.relname
|
89
50
|
[0m
|
90
|
-
[1m[
|
91
|
-
[1m[35m (0.1ms)[0m SET search_path TO public
|
92
|
-
[1m[36m (213.5ms)[0m [1mDROP DATABASE IF EXISTS "tmp_fix_test"[0m
|
93
|
-
[1m[35m (0.1ms)[0m SET search_path TO public
|
94
|
-
[1m[36m (0.2ms)[0m [1mCREATE DATABASE "tmp_fix_test" ENCODING = 'unicode'[0m
|
95
|
-
PGError: ERROR: permission denied to create database
|
96
|
-
: CREATE DATABASE "tmp_fix_test" ENCODING = 'unicode'
|
97
|
-
[1m[36m (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
98
|
-
[1m[35m (0.1ms)[0m SET search_path TO public
|
99
|
-
[1m[36m (0.1ms)[0m [1mDROP DATABASE IF EXISTS "tmp_fix_test"[0m
|
100
|
-
[1m[35m (0.1ms)[0m SET search_path TO public
|
101
|
-
[1m[36m (0.3ms)[0m [1mCREATE DATABASE "tmp_fix_test" ENCODING = 'unicode'[0m
|
102
|
-
PGError: ERROR: permission denied to create database
|
103
|
-
: CREATE DATABASE "tmp_fix_test" ENCODING = 'unicode'
|
104
|
-
[1m[36m (50.6ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) [0m
|
105
|
-
[1m[35m (0.1ms)[0m SHOW search_path
|
106
|
-
[1m[36m (2.1ms)[0m [1m SELECT distinct i.relname, d.indisunique, d.indkey, t.oid
|
107
|
-
FROM pg_class t
|
108
|
-
INNER JOIN pg_index d ON t.oid = d.indrelid
|
109
|
-
INNER JOIN pg_class i ON d.indexrelid = i.oid
|
110
|
-
WHERE i.relkind = 'i'
|
111
|
-
AND d.indisprimary = 'f'
|
112
|
-
AND t.relname = 'schema_migrations'
|
113
|
-
AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname IN ('"$user"','public') )
|
114
|
-
ORDER BY i.relname
|
115
|
-
[0m
|
116
|
-
[1m[35m (39.0ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
117
|
-
[1m[36m (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
118
|
-
Migrating to CreateUsers (20110908165659)
|
119
|
-
[1m[35m (0.1ms)[0m BEGIN
|
120
|
-
[1m[36m (37.5ms)[0m [1mCREATE TABLE "users" ("id" serial primary key, "name" character varying(255), "created_at" timestamp, "updated_at" timestamp) [0m
|
121
|
-
[1m[35m (0.4ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20110908165659')
|
122
|
-
[1m[36m (63.1ms)[0m [1mCOMMIT[0m
|
123
|
-
Migrating to CreateBooks (20110908165716)
|
124
|
-
[1m[35m (0.1ms)[0m BEGIN
|
125
|
-
[1m[36m (33.0ms)[0m [1mCREATE TABLE "books" ("id" serial primary key, "name" character varying(255), "user_id" integer, "created_at" timestamp, "updated_at" timestamp) [0m
|
126
|
-
[1m[35m (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20110908165716')
|
127
|
-
[1m[36m (5.1ms)[0m [1mCOMMIT[0m
|
128
|
-
Migrating to AddReferences (20110909072642)
|
129
|
-
[1m[35m (0.1ms)[0m BEGIN
|
130
|
-
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
131
|
-
[1m[36m (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
132
|
-
Migrating to CreateUsers (20110908165659)
|
133
|
-
Migrating to CreateBooks (20110908165716)
|
134
|
-
Migrating to AddReferences (20110909072642)
|
135
|
-
[1m[35m (0.1ms)[0m BEGIN
|
136
|
-
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
137
|
-
[1m[36m (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
138
|
-
Migrating to CreateUsers (20110908165659)
|
139
|
-
Migrating to CreateBooks (20110908165716)
|
140
|
-
Migrating to AddReferences (20110909072642)
|
141
|
-
[1m[35m (0.1ms)[0m BEGIN
|
142
|
-
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
143
|
-
[1m[36m (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
144
|
-
Migrating to CreateUsers (20110908165659)
|
145
|
-
Migrating to CreateBooks (20110908165716)
|
146
|
-
Migrating to AddReferences (20110909072642)
|
147
|
-
[1m[35m (0.1ms)[0m BEGIN
|
148
|
-
[1m[36m (0.5ms)[0m [1mROLLBACK[0m
|
149
|
-
[1m[36m (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
150
|
-
Migrating to CreateUsers (20110908165659)
|
151
|
-
Migrating to CreateBooks (20110908165716)
|
152
|
-
Migrating to AddReferences (20110909072642)
|
153
|
-
[1m[35m (0.1ms)[0m BEGIN
|
154
|
-
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
155
|
-
[1m[36m (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
156
|
-
Migrating to CreateUsers (20110908165659)
|
157
|
-
Migrating to CreateBooks (20110908165716)
|
158
|
-
Migrating to AddReferences (20110909072642)
|
159
|
-
[1m[35m (0.1ms)[0m BEGIN
|
160
|
-
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
161
|
-
[1m[36m (0.4ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
162
|
-
Migrating to CreateUsers (20110908165659)
|
163
|
-
Migrating to CreateBooks (20110908165716)
|
164
|
-
Migrating to AddReferences (20110909072642)
|
165
|
-
[1m[35m (0.1ms)[0m BEGIN
|
166
|
-
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
167
|
-
[1m[36m (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
168
|
-
Migrating to CreateUsers (20110908165659)
|
169
|
-
Migrating to CreateBooks (20110908165716)
|
170
|
-
Migrating to AddReferences (20110909072642)
|
171
|
-
[1m[35m (0.1ms)[0m BEGIN
|
172
|
-
[1m[36m (2.0ms)[0m [1mALTER TABLE "books" ADD CONSTRAINT "books_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"(id)[0m
|
173
|
-
[1m[35m (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20110909072642')
|
174
|
-
[1m[36m (17.0ms)[0m [1mCOMMIT[0m
|
175
|
-
[1m[35m (0.2ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
176
|
-
[1m[36m (0.1ms)[0m [1mSHOW search_path[0m
|
177
|
-
[1m[35m (1.3ms)[0m SELECT distinct i.relname, d.indisunique, d.indkey, t.oid
|
178
|
-
FROM pg_class t
|
179
|
-
INNER JOIN pg_index d ON t.oid = d.indrelid
|
180
|
-
INNER JOIN pg_class i ON d.indexrelid = i.oid
|
181
|
-
WHERE i.relkind = 'i'
|
182
|
-
AND d.indisprimary = 'f'
|
183
|
-
AND t.relname = 'books'
|
184
|
-
AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname IN ('"$user"','public') )
|
185
|
-
ORDER BY i.relname
|
186
|
-
[1m[36m (0.8ms)[0m [1m SELECT distinct i.relname, d.indisunique, d.indkey, t.oid
|
187
|
-
FROM pg_class t
|
188
|
-
INNER JOIN pg_index d ON t.oid = d.indrelid
|
189
|
-
INNER JOIN pg_class i ON d.indexrelid = i.oid
|
190
|
-
WHERE i.relkind = 'i'
|
191
|
-
AND d.indisprimary = 'f'
|
192
|
-
AND t.relname = 'users'
|
193
|
-
AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname IN ('"$user"','public') )
|
194
|
-
ORDER BY i.relname
|
195
|
-
[0m
|
196
|
-
[1m[35m (2.9ms)[0m
|
51
|
+
[1m[35m (3.0ms)[0m
|
197
52
|
SELECT t2.relname AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confdeltype AS dependency
|
198
53
|
FROM pg_constraint c
|
199
54
|
JOIN pg_class t1 ON c.conrelid = t1.oid
|
@@ -206,7 +61,7 @@ Migrating to AddReferences (20110909072642)
|
|
206
61
|
AND t3.nspname = ANY (current_schemas(false))
|
207
62
|
ORDER BY c.conname
|
208
63
|
|
209
|
-
[1m[36m (
|
64
|
+
[1m[36m (2.6ms)[0m [1m
|
210
65
|
SELECT t2.relname AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confdeltype AS dependency
|
211
66
|
FROM pg_constraint c
|
212
67
|
JOIN pg_class t1 ON c.conrelid = t1.oid
|