rails_sql_views4 0.0.1 → 0.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 544ca00235098c24ee35405ec3e987b4f5ab6bcd
4
- data.tar.gz: ee2305432c09bd0d162a5f1cd22604449074bc99
3
+ metadata.gz: 6c02f5c00bad55e5de74007d32ed14aa3aa8bb5a
4
+ data.tar.gz: 9a78a4c88903c846afb96a3a15a3cb19c3652be9
5
5
  SHA512:
6
- metadata.gz: 628f2d45cc82e7ed647096a9a0f20748e4a82d7d5995c846bea5e3f7991ac4c7126d29e530d4e3806625d01a967d683e129fee8bb00e9f09420c0460343099aa
7
- data.tar.gz: 69e04f6f5de2f4c7ae9186bb5e7b01e46da7c1bfafa052506a6412eab287534e1f355502f6d7d34a769495f1f0cd5c20f39705fddc672ba9021087fd07294202
6
+ metadata.gz: 435ff55234b6fbe9ae0bde92c0e414e5cd1eb2ba12b39439eb5832048beed7bedcd5fb5e17218b9dff6ffbcbda0c7b1d1312b23decd4aba5ea15211e2c9c22ca
7
+ data.tar.gz: eee216b8a5db4c4e073bf05289f72fb0552f53716c59f29d2e6c0aa8f7bfa21cfb8f2febc560202cf92abac5af200013675170737cba0b369631a172fbc26c6e
@@ -10,6 +10,14 @@ module RailsSqlViews4
10
10
  # [<tt>:check_option</tt>]
11
11
  # Specify restrictions for inserts or updates in updatable views. ANSI SQL 92 defines two check option
12
12
  # values: CASCADED and LOCAL. See your database documentation for allowed values.
13
+ #
14
+ #
15
+ # we have a problem with the force option in postgres
16
+ # rescue nil will rescue the ruby program, but we still have an error for postgres
17
+ # and unfortunatly for postgress, the first error will stop the interpretor :
18
+ # ActiveRecord::StatementInvalid Exception: PG::InFailedSqlTransaction: ERROR:
19
+ # current transaction is aborted, commands ignored until end of transaction block
20
+ #
13
21
  def create_view(name, select_query, options={})
14
22
  if supports_views?
15
23
  view_definition = ViewDefinition.new(self, select_query)
@@ -19,6 +27,7 @@ module RailsSqlViews4
19
27
  end
20
28
 
21
29
  if options[:force]
30
+ puts" TOTO : Please, force option is not correctly implemented in postgres"
22
31
  drop_view(name) rescue nil
23
32
  end
24
33
 
@@ -31,6 +40,7 @@ module RailsSqlViews4
31
40
  end
32
41
  create_sql << "AS #{view_definition.select_query}"
33
42
  create_sql << " WITH #{options[:check_option]} CHECK OPTION" if options[:check_option]
43
+ debugger;
34
44
  execute create_sql
35
45
  end
36
46
  end
@@ -74,7 +84,8 @@ module RailsSqlViews4
74
84
  # Specify the drop behavior. ANSI SQL 92 defines two drop behaviors, CASCADE and RESTRICT. See your
75
85
  # database documentation to determine what drop behaviors are available.
76
86
  def drop_view(name, options={})
77
- if supports_views?
87
+ # if supports_views? # because of postgres (see create_view with force option)
88
+ if supports_views? & table_exists?(name)
78
89
  drop_sql = "DROP VIEW #{quote_table_name(name)}"
79
90
  drop_sql << " #{options[:drop_behavior]}" if options[:drop_behavior]
80
91
  execute drop_sql
@@ -20,6 +20,17 @@ module RailsSqlViews4
20
20
  query(q, name).map { |row| row[0] }
21
21
  end
22
22
 
23
+ def tables(name = nil) #:nodoc:
24
+ q = <<-SQL
25
+ SELECT table_name, table_type
26
+ FROM information_schema.tables
27
+ WHERE table_schema IN (#{schemas})
28
+ AND table_type = 'TABLE'
29
+ SQL
30
+
31
+ query(q, name).map { |row| row[0] }
32
+ end
33
+
23
34
  def base_tables(name = nil)
24
35
  q = <<-SQL
25
36
  SELECT table_name, table_type
@@ -55,7 +66,7 @@ module RailsSqlViews4
55
66
  # TODO
56
67
  # puts in postgres adapter ??? not in SQLITE ?
57
68
  # select_value(q, name) or raise "No view called #{view} found"
58
- select_value(q, name).gsub("CREATE VIEW #{view} AS ", "")) or raise "No view called #{view} found"
69
+ select_value(q, name).gsub("CREATE VIEW #{view} AS ", "") or raise "No view called #{view} found"
59
70
 
60
71
  end
61
72
 
@@ -1,3 +1,3 @@
1
1
  module RailsSqlViews4
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/test/adapter_test.rb CHANGED
@@ -9,6 +9,7 @@ class AdapterTest < ActiveSupport::TestCase
9
9
  end
10
10
 
11
11
  def test_tables
12
+ debugger
12
13
  create_view
13
14
  found = ActiveRecord::Base.connection.tables.sort
14
15
  found.delete(ActiveRecord::Migrator.schema_migrations_table_name)
@@ -5,20 +5,23 @@
5
5
  # gem 'sqlite3'
6
6
  #
7
7
  default: &default
8
- adapter: sqlite3
8
+ adapter: postgresql
9
9
  pool: 5
10
10
  timeout: 5000
11
11
 
12
12
  development:
13
- <<: *default
14
- database: db/development.sqlite3
13
+ adapter: postgresql
14
+ encoding: unicode
15
+ database: rails_sql_views4_development
16
+
15
17
 
16
18
  # Warning: The database defined as "test" will be erased and
17
19
  # re-generated from your development database when you run "rake".
18
20
  # Do not set this db to the same as development or production.
19
21
  test:
20
- <<: *default
21
- database: db/test.sqlite3
22
+ adapter: postgresql
23
+ encoding: unicode
24
+ database: rails_sql_views_unittest
22
25
 
23
26
  production:
24
27
  <<: *default
@@ -13,6 +13,9 @@
13
13
 
14
14
  ActiveRecord::Schema.define(version: 20141228200440) do
15
15
 
16
+ # These are extensions that must be enabled in order to support this database
17
+ enable_extension "plpgsql"
18
+
16
19
  create_table "items", force: true do |t|
17
20
  t.integer "person_id"
18
21
  t.datetime "created_at"
@@ -437,3 +437,248 @@ SQLite3::SQLException: no such view: v_people: DROP VIEW "v_people"
437
437
   (0.8ms) DROP VIEW "v_people"
438
438
   (0.9ms) CREATE VIEW "v_people" AS select id, first_name, last_name, ssn, address_id from people
439
439
   (0.1ms) SELECT version FROM "schema_migrations"
440
+  (3.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
441
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
442
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
443
+ Migrating to CreatePeople (20141228200436)
444
+  (0.1ms) BEGIN
445
+  (3.1ms) CREATE TABLE "people" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "ssn" character varying, "address_id" integer) 
446
+ SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200436"]]
447
+  (0.3ms) COMMIT
448
+ Migrating to CreatePeople2 (20141228200437)
449
+  (0.3ms) BEGIN
450
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200437_create_people2.rb:8)
451
+  (3.1ms) CREATE TABLE "people2" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "ssn" character varying, "created_at" timestamp, "updated_at" timestamp) 
452
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200437"]]
453
+  (0.4ms) COMMIT
454
+ Migrating to CreatePlaces (20141228200438)
455
+  (0.2ms) BEGIN
456
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200438_create_places.rb:9)
457
+  (3.3ms) CREATE TABLE "places" ("id" serial primary key, "address" text, "city" character varying, "cstate" character varying, "country" character varying, "created_at" timestamp, "updated_at" timestamp) 
458
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200438"]]
459
+  (0.5ms) COMMIT
460
+ Migrating to CreateItems (20141228200439)
461
+  (0.2ms) BEGIN
462
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200439_create_items.rb:5)
463
+  (1.6ms) CREATE TABLE "items" ("id" serial primary key, "person_id" integer, "created_at" timestamp, "updated_at" timestamp) 
464
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200439"]]
465
+  (0.4ms) COMMIT
466
+ Migrating to CreateItemsPeople (20141228200440)
467
+  (0.2ms) BEGIN
468
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200440_create_items_people.rb:6)
469
+  (2.2ms) CREATE TABLE "items_people" ("id" serial primary key, "person_id" integer, "item_id" integer, "created_at" timestamp, "updated_at" timestamp) 
470
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200440"]]
471
+  (0.3ms) COMMIT
472
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
473
+  (2.5ms)  SELECT table_name, table_type
474
+ FROM information_schema.tables
475
+ WHERE table_schema IN ('"$user"','public')
476
+ AND table_type = 'BASE TABLE'
477
+ 
478
+  (0.7ms) SELECT table_name, table_type
479
+ FROM information_schema.tables
480
+ WHERE table_schema IN ('"$user"','public')
481
+ AND table_type = 'VIEW'
482
+
483
+  (2.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
484
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
485
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
486
+ Migrating to CreatePeople (20141228200436)
487
+  (0.1ms) BEGIN
488
+  (3.0ms) CREATE TABLE "people" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "ssn" character varying, "address_id" integer) 
489
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200436"]]
490
+  (0.4ms) COMMIT
491
+ Migrating to CreatePeople2 (20141228200437)
492
+  (0.3ms) BEGIN
493
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200437_create_people2.rb:8)
494
+  (2.2ms) CREATE TABLE "people2" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "ssn" character varying, "created_at" timestamp, "updated_at" timestamp) 
495
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200437"]]
496
+  (0.4ms) COMMIT
497
+ Migrating to CreatePlaces (20141228200438)
498
+  (0.2ms) BEGIN
499
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200438_create_places.rb:9)
500
+  (2.5ms) CREATE TABLE "places" ("id" serial primary key, "address" text, "city" character varying, "cstate" character varying, "country" character varying, "created_at" timestamp, "updated_at" timestamp) 
501
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200438"]]
502
+  (0.4ms) COMMIT
503
+ Migrating to CreateItems (20141228200439)
504
+  (0.3ms) BEGIN
505
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200439_create_items.rb:5)
506
+  (2.9ms) CREATE TABLE "items" ("id" serial primary key, "person_id" integer, "created_at" timestamp, "updated_at" timestamp) 
507
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200439"]]
508
+  (0.3ms) COMMIT
509
+ Migrating to CreateItemsPeople (20141228200440)
510
+  (0.2ms) BEGIN
511
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200440_create_items_people.rb:6)
512
+  (1.7ms) CREATE TABLE "items_people" ("id" serial primary key, "person_id" integer, "item_id" integer, "created_at" timestamp, "updated_at" timestamp) 
513
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200440"]]
514
+  (0.4ms) COMMIT
515
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
516
+  (2.6ms)  SELECT table_name, table_type
517
+ FROM information_schema.tables
518
+ WHERE table_schema IN ('"$user"','public')
519
+ AND table_type = 'BASE TABLE'
520
+ 
521
+  (0.6ms) SELECT table_name, table_type
522
+ FROM information_schema.tables
523
+ WHERE table_schema IN ('"$user"','public')
524
+ AND table_type = 'VIEW'
525
+
526
+  (2.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
527
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
528
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
529
+ Migrating to CreatePeople (20141228200436)
530
+  (0.1ms) BEGIN
531
+  (2.7ms) CREATE TABLE "people" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "ssn" character varying, "address_id" integer) 
532
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200436"]]
533
+  (0.5ms) COMMIT
534
+ Migrating to CreatePeople2 (20141228200437)
535
+  (0.2ms) BEGIN
536
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200437_create_people2.rb:8)
537
+  (2.4ms) CREATE TABLE "people2" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "ssn" character varying, "created_at" timestamp, "updated_at" timestamp) 
538
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200437"]]
539
+  (1.3ms) COMMIT
540
+ Migrating to CreatePlaces (20141228200438)
541
+  (0.2ms) BEGIN
542
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200438_create_places.rb:9)
543
+  (2.1ms) CREATE TABLE "places" ("id" serial primary key, "address" text, "city" character varying, "cstate" character varying, "country" character varying, "created_at" timestamp, "updated_at" timestamp) 
544
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200438"]]
545
+  (0.3ms) COMMIT
546
+ Migrating to CreateItems (20141228200439)
547
+  (0.3ms) BEGIN
548
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200439_create_items.rb:5)
549
+  (2.5ms) CREATE TABLE "items" ("id" serial primary key, "person_id" integer, "created_at" timestamp, "updated_at" timestamp) 
550
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200439"]]
551
+  (0.3ms) COMMIT
552
+ Migrating to CreateItemsPeople (20141228200440)
553
+  (0.2ms) BEGIN
554
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200440_create_items_people.rb:6)
555
+  (1.5ms) CREATE TABLE "items_people" ("id" serial primary key, "person_id" integer, "item_id" integer, "created_at" timestamp, "updated_at" timestamp) 
556
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200440"]]
557
+  (0.4ms) COMMIT
558
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
559
+  (3.4ms)  SELECT table_name, table_type
560
+ FROM information_schema.tables
561
+ WHERE table_schema IN ('"$user"','public')
562
+ AND table_type = 'BASE TABLE'
563
+ 
564
+  (0.7ms) SELECT table_name, table_type
565
+ FROM information_schema.tables
566
+ WHERE table_schema IN ('"$user"','public')
567
+ AND table_type = 'VIEW'
568
+
569
+  (2.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
570
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
571
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
572
+ Migrating to CreatePeople (20141228200436)
573
+  (0.1ms) BEGIN
574
+  (3.1ms) CREATE TABLE "people" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "ssn" character varying, "address_id" integer) 
575
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200436"]]
576
+  (0.4ms) COMMIT
577
+ Migrating to CreatePeople2 (20141228200437)
578
+  (0.3ms) BEGIN
579
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200437_create_people2.rb:8)
580
+  (2.4ms) CREATE TABLE "people2" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "ssn" character varying, "created_at" timestamp, "updated_at" timestamp) 
581
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200437"]]
582
+  (0.3ms) COMMIT
583
+ Migrating to CreatePlaces (20141228200438)
584
+  (0.5ms) BEGIN
585
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200438_create_places.rb:9)
586
+  (2.6ms) CREATE TABLE "places" ("id" serial primary key, "address" text, "city" character varying, "cstate" character varying, "country" character varying, "created_at" timestamp, "updated_at" timestamp) 
587
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200438"]]
588
+  (0.3ms) COMMIT
589
+ Migrating to CreateItems (20141228200439)
590
+  (0.3ms) BEGIN
591
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200439_create_items.rb:5)
592
+  (2.1ms) CREATE TABLE "items" ("id" serial primary key, "person_id" integer, "created_at" timestamp, "updated_at" timestamp) 
593
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200439"]]
594
+  (0.3ms) COMMIT
595
+ Migrating to CreateItemsPeople (20141228200440)
596
+  (0.2ms) BEGIN
597
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200440_create_items_people.rb:6)
598
+  (1.5ms) CREATE TABLE "items_people" ("id" serial primary key, "person_id" integer, "item_id" integer, "created_at" timestamp, "updated_at" timestamp) 
599
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200440"]]
600
+  (0.3ms) COMMIT
601
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
602
+  (2.7ms)  SELECT table_name, table_type
603
+ FROM information_schema.tables
604
+ WHERE table_schema IN ('"$user"','public')
605
+ AND table_type = 'BASE TABLE'
606
+ 
607
+  (0.7ms) SELECT table_name, table_type
608
+ FROM information_schema.tables
609
+ WHERE table_schema IN ('"$user"','public')
610
+ AND table_type = 'VIEW'
611
+
612
+  (16.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
613
+  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
614
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
615
+ Migrating to CreatePeople (20141228200436)
616
+  (0.1ms) BEGIN
617
+  (2.9ms) CREATE TABLE "people" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "ssn" character varying, "address_id" integer) 
618
+ SQL (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200436"]]
619
+  (0.8ms) COMMIT
620
+ Migrating to CreatePeople2 (20141228200437)
621
+  (0.3ms) BEGIN
622
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200437_create_people2.rb:8)
623
+  (2.5ms) CREATE TABLE "people2" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "ssn" character varying, "created_at" timestamp, "updated_at" timestamp) 
624
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200437"]]
625
+  (0.5ms) COMMIT
626
+ Migrating to CreatePlaces (20141228200438)
627
+  (0.2ms) BEGIN
628
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200438_create_places.rb:9)
629
+  (2.5ms) CREATE TABLE "places" ("id" serial primary key, "address" text, "city" character varying, "cstate" character varying, "country" character varying, "created_at" timestamp, "updated_at" timestamp) 
630
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200438"]]
631
+  (0.4ms) COMMIT
632
+ Migrating to CreateItems (20141228200439)
633
+  (0.3ms) BEGIN
634
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200439_create_items.rb:5)
635
+  (2.0ms) CREATE TABLE "items" ("id" serial primary key, "person_id" integer, "created_at" timestamp, "updated_at" timestamp) 
636
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200439"]]
637
+  (0.4ms) COMMIT
638
+ Migrating to CreateItemsPeople (20141228200440)
639
+  (0.3ms) BEGIN
640
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/laurent/Desktop/code/rails_sql_views4/test/dummy/db/migrate/20141228200440_create_items_people.rb:6)
641
+  (2.2ms) CREATE TABLE "items_people" ("id" serial primary key, "person_id" integer, "item_id" integer, "created_at" timestamp, "updated_at" timestamp) 
642
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141228200440"]]
643
+  (0.3ms) COMMIT
644
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
645
+  (5.5ms)  SELECT table_name, table_type
646
+ FROM information_schema.tables
647
+ WHERE table_schema IN ('"$user"','public')
648
+ AND table_type = 'BASE TABLE'
649
+ 
650
+  (0.8ms) SELECT table_name, table_type
651
+ FROM information_schema.tables
652
+ WHERE table_schema IN ('"$user"','public')
653
+ AND table_type = 'VIEW'
654
+
655
+  (0.3ms) DROP VIEW "v_people"
656
+ PG::UndefinedTable: ERROR: view "v_people" does not exist
657
+ : DROP VIEW "v_people"
658
+  (2.4ms) CREATE VIEW "v_people" AS select first_name, last_name, ssn from people
659
+  (4.2ms)  SELECT table_name, table_type
660
+ FROM information_schema.tables
661
+ WHERE table_schema IN ('"$user"','public')
662
+ AND table_type IN ('BASE TABLE', 'VIEW')
663
+ 
664
+ Person Load (0.5ms) SELECT "people".* FROM "people"
665
+  (4.0ms) SELECT table_name, table_type
666
+ FROM information_schema.tables
667
+ WHERE table_schema IN ('"$user"','public')
668
+ AND table_type IN ('BASE TABLE', 'VIEW')
669
+
670
+  (0.2ms) BEGIN
671
+ SQL (0.7ms) INSERT INTO "people" ("first_name", "last_name") VALUES ($1, $2) RETURNING "id" [["first_name", "Laurent"], ["last_name", "Buffat"]]
672
+  (0.4ms) COMMIT
673
+  (0.2ms) BEGIN
674
+ SQL (0.5ms) INSERT INTO "people" ("last_name", "first_name") VALUES ($1, $2) RETURNING "id" [["last_name", "Villemagne"], ["first_name", "Genevieve"]]
675
+  (1.0ms) COMMIT
676
+ Person Load (0.4ms) SELECT "people".* FROM "people"
677
+  (2.2ms)  SELECT table_name, table_type
678
+ FROM information_schema.tables
679
+ WHERE table_schema IN ('"$user"','public')
680
+ AND table_type IN ('BASE TABLE', 'VIEW')
681
+ 
682
+ Person Load (0.7ms) SELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1
683
+ VPerson Load (0.9ms) SELECT "v_people".* FROM "v_people" LIMIT 1
684
+ Person Load (0.5ms) SELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1