  [1m[36mSQL (0.4ms)[0m  [1m SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
[0m
  [1m[36mSQL (0.4ms)[0m  [1m SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
[0m
  [1m[35mSQL (0.1ms)[0m  select sqlite_version(*)
  [1m[36mSQL (2.0ms)[0m  [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
  [1m[35mSQL (0.1ms)[0m  PRAGMA index_list("schema_migrations")
  [1m[36mSQL (1.0ms)[0m  [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
  [1m[35mSQL (0.2ms)[0m   SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
  [1m[36mSQL (0.1ms)[0m  [1m SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
[0m
  [1m[35mSQL (0.1ms)[0m  SELECT "schema_migrations"."version" FROM "schema_migrations"
Migrating to CreateBooks (20101215025724)
  [1m[36mSQL (0.4ms)[0m  [1mCREATE TABLE "books" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
  [1m[35mSQL (0.1ms)[0m  INSERT INTO "schema_migrations" ("version") VALUES ('20101215025724')
Migrating to CreateChapters (20101215025803)
  [1m[36mSQL (0.3ms)[0m  [1mCREATE TABLE "chapters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "body" text, "version" integer, "book_id" integer, "created_at" datetime, "updated_at" datetime) [0m
  [1m[35mSQL (0.3ms)[0m   SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
  [1m[36mSQL (0.3ms)[0m  [1m SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
[0m
  [1m[35mSQL (0.1ms)[0m  select sqlite_version(*)
  [1m[36mSQL (2.6ms)[0m  [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
  [1m[35mSQL (0.0ms)[0m  PRAGMA index_list("schema_migrations")
  [1m[36mSQL (1.1ms)[0m  [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
  [1m[35mSQL (0.1ms)[0m   SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
  [1m[36mSQL (0.1ms)[0m  [1m SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
[0m
  [1m[35mSQL (0.1ms)[0m  SELECT "schema_migrations"."version" FROM "schema_migrations"
Migrating to CreateBooks (20101215025724)
  [1m[36mSQL (0.6ms)[0m  [1mCREATE TABLE "books" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
  [1m[35mSQL (0.2ms)[0m  INSERT INTO "schema_migrations" ("version") VALUES ('20101215025724')
Migrating to CreateChapters (20101215025803)
  [1m[36mSQL (0.5ms)[0m  [1mCREATE TABLE "chapters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "body" text, "version" integer, "book_id" integer, "created_at" datetime, "updated_at" datetime) [0m
  [1m[35mSQL (0.2ms)[0m   SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
  [1m[36mSQL (0.2ms)[0m  [1mCREATE TABLE "chapter_versions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "chapter_id" integer, "version" integer) [0m
  [1m[35mSQL (0.3ms)[0m  ALTER TABLE "chapter_versions" ADD "title" varchar(255) DEFAULT NULL
  [1m[36mSQL (0.1ms)[0m  [1mALTER TABLE "chapter_versions" ADD "body" text DEFAULT NULL[0m
  [1m[35mSQL (0.2ms)[0m  ALTER TABLE "chapter_versions" ADD "book_id" integer DEFAULT NULL
  [1m[36mSQL (0.2ms)[0m  [1mALTER TABLE "chapter_versions" ADD "created_at" datetime DEFAULT NULL[0m
  [1m[35mSQL (0.2ms)[0m  ALTER TABLE "chapter_versions" ADD "updated_at" datetime DEFAULT NULL
  [1m[36mSQL (0.1ms)[0m  [1mPRAGMA index_list("chapter_versions")[0m
  [1m[35mSQL (0.2ms)[0m  CREATE INDEX "index_chapter_versions_on_chapter_id" ON "chapter_versions" ("chapter_id")
  [1m[36mSQL (0.2ms)[0m  [1mINSERT INTO "schema_migrations" ("version") VALUES ('20101215025803')[0m
  [1m[35mSQL (0.2ms)[0m   SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
  [1m[36mSQL (0.1ms)[0m  [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
  [1m[35mSQL (0.1ms)[0m   SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
  [1m[36mSQL (0.0ms)[0m  [1mPRAGMA index_list("books")[0m
  [1m[35mSQL (0.1ms)[0m  PRAGMA index_list("chapter_versions")
  [1m[36mSQL (0.0ms)[0m  [1mPRAGMA index_info('index_chapter_versions_on_chapter_id')[0m
  [1m[35mSQL (0.1ms)[0m  PRAGMA index_list("chapters")
  [1m[36mSQL (0.8ms)[0m  [1m SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
[0m
  [1m[35mSQL (0.2ms)[0m   SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
  [1m[36mSQL (0.1ms)[0m  [1mSELECT "schema_migrations"."version" FROM "schema_migrations"[0m
Migrating to CreateBooks (20101215025724)
Migrating to CreateChapters (20101215025803)
  [1m[35mSQL (0.1ms)[0m  select sqlite_version(*)
  [1m[36mSQL (0.2ms)[0m  [1m SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
[0m
  [1m[35mSQL (0.1ms)[0m  SELECT "schema_migrations"."version" FROM "schema_migrations"
  [1m[36mSQL (0.1ms)[0m  [1m SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
[0m
  [1m[35mSQL (0.0ms)[0m  PRAGMA index_list("books")
  [1m[36mSQL (0.1ms)[0m  [1mPRAGMA index_list("chapter_versions")[0m
  [1m[35mSQL (0.1ms)[0m  PRAGMA index_info('index_chapter_versions_on_chapter_id')
  [1m[36mSQL (0.0ms)[0m  [1mPRAGMA index_list("chapters")[0m
  [1m[36mSQL (0.2ms)[0m  [1m SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
[0m
  [1m[35mAREL (0.4ms)[0m  INSERT INTO "chapters" ("title", "body", "version", "book_id", "created_at", "updated_at") VALUES ('Ligeti''s Legacy', 'Ligeti turned in time to see a look of terror sweep over his wife''s face..', 1, NULL, '2010-12-15 03:30:35.524869', '2010-12-15 03:30:35.524869')
  [1m[36mAREL (0.2ms)[0m  [1mINSERT INTO "chapter_versions" ("chapter_id", "version", "title", "body", "book_id", "created_at", "updated_at") VALUES (1, 1, 'Ligeti''s Legacy', 'Ligeti turned in time to see a look of terror sweep over his wife''s face..', NULL, '2010-12-15 03:30:35.524869', '2010-12-15 03:30:35.524869')[0m
  [1m[35mSQL (0.3ms)[0m  SELECT MAX("chapter_versions"."version") AS max_id FROM "chapter_versions" WHERE ("chapter_versions".chapter_id = 1)
  [1m[36mAREL (0.2ms)[0m  [1mUPDATE "chapters" SET "title" = 'Ligeti''s Legacy of Lunacy', "version" = 2, "updated_at" = '2010-12-15 03:31:03.303447' WHERE ("chapters"."id" = 1)[0m
  [1m[35mAREL (0.1ms)[0m  INSERT INTO "chapter_versions" ("chapter_id", "version", "title", "body", "book_id", "created_at", "updated_at") VALUES (1, 2, 'Ligeti''s Legacy of Lunacy', 'Ligeti turned in time to see a look of terror sweep over his wife''s face..', NULL, '2010-12-15 03:30:35.524869', '2010-12-15 03:31:03.303447')
  [1m[36mSQL (0.3ms)[0m  [1mSELECT COUNT(*) FROM "chapter_versions" WHERE ("chapter_versions".chapter_id = 1)[0m
  [1m[35mChapter::Version Load (0.6ms)[0m  SELECT "chapter_versions".* FROM "chapter_versions" WHERE ("chapter_versions".chapter_id = 1)
  [1m[36mChapter::Version Load (0.5ms)[0m  [1mSELECT "chapter_versions".* FROM "chapter_versions" WHERE ("chapter_versions".chapter_id = 1)[0m
  [1m[35mSQL (0.3ms)[0m   SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
  [1m[36mSQL (0.5ms)[0m  [1m SELECT name
 FROM sqlite_master
 WHERE type = 'table' AND NOT name = 'sqlite_sequence'
[0m
  [1m[35mChapter::Version Load (1.0ms)[0m  SELECT "chapter_versions".* FROM "chapter_versions" WHERE (chapter_id = 1 and version > 1) ORDER BY version ASC LIMIT 1
  [1m[36mChapter::Version Load (0.8ms)[0m  [1mSELECT "chapter_versions".* FROM "chapter_versions" WHERE ("chapter_versions".chapter_id = 1) AND ("chapter_versions"."id" = 2) LIMIT 1[0m
  [1m[35mChapter::Version Load (0.4ms)[0m  SELECT "chapter_versions".* FROM "chapter_versions" WHERE ("chapter_versions".chapter_id = 1) AND ("chapter_versions"."version" = 2) LIMIT 1
  [1m[36mChapter::Version Load (0.8ms)[0m  [1mSELECT "chapter_versions".* FROM "chapter_versions" WHERE ("chapter_versions".chapter_id = 1) AND ("chapter_versions"."version" = 1) LIMIT 1[0m
  [1m[35mChapter::Version Load (0.7ms)[0m  SELECT "chapter_versions".* FROM "chapter_versions" WHERE ("chapter_versions".chapter_id = 1) AND ("chapter_versions"."version" = 1) LIMIT 1
  [1m[36mSQL (0.3ms)[0m  [1mSELECT MAX("chapter_versions"."version") AS max_id FROM "chapter_versions" WHERE ("chapter_versions".chapter_id = 1)[0m
  [1m[35mAREL (0.4ms)[0m  UPDATE "chapters" SET "title" = 'Another version''s title', "body" = 'Ligeti turned in time to see a look of terror sweep over his wife''s face..', "updated_at" = '2010-12-15 03:30:35.524869', "version" = 3 WHERE ("chapters"."id" = 1)
  [1m[36mAREL (0.2ms)[0m  [1mINSERT INTO "chapter_versions" ("chapter_id", "version", "title", "body", "book_id", "created_at", "updated_at") VALUES (1, 3, 'Another version''s title', 'Ligeti turned in time to see a look of terror sweep over his wife''s face..', NULL, '2010-12-15 03:30:35.524869', '2010-12-15 03:30:35.524869')[0m
  [1m[35mAREL (0.5ms)[0m  INSERT INTO "chapters" ("title", "body", "version", "book_id", "created_at", "updated_at") VALUES ('The Next Day', 'Ligeti woke up with a throbbing headache...', 1, NULL, '2010-12-15 03:47:42.578755', '2010-12-15 03:47:42.578755')
  [1m[36mAREL (0.2ms)[0m  [1mINSERT INTO "chapter_versions" ("chapter_id", "version", "title", "body", "book_id", "created_at", "updated_at") VALUES (2, 1, 'The Next Day', 'Ligeti woke up with a throbbing headache...', NULL, '2010-12-15 03:47:42.578755', '2010-12-15 03:47:42.578755')[0m
  [1m[35mSQL (0.3ms)[0m  SELECT MAX("chapter_versions"."version") AS max_id FROM "chapter_versions" WHERE ("chapter_versions".chapter_id = 2)
  [1m[36mAREL (0.3ms)[0m  [1mUPDATE "chapters" SET "title" = 'different title', "version" = 2, "updated_at" = '2010-12-15 03:47:52.786031' WHERE ("chapters"."id" = 2)[0m
  [1m[35mAREL (0.2ms)[0m  INSERT INTO "chapter_versions" ("chapter_id", "version", "title", "body", "book_id", "created_at", "updated_at") VALUES (2, 2, 'different title', 'Ligeti woke up with a throbbing headache...', NULL, '2010-12-15 03:47:42.578755', '2010-12-15 03:47:52.786031')
  [1m[36mSQL (0.3ms)[0m  [1mSELECT MAX("chapter_versions"."version") AS max_id FROM "chapter_versions" WHERE ("chapter_versions".chapter_id = 2)[0m
  [1m[35mAREL (0.3ms)[0m  UPDATE "chapters" SET "title" = 'different title again', "version" = 3, "updated_at" = '2010-12-15 03:48:41.299338' WHERE ("chapters"."id" = 2)
  [1m[36mAREL (0.2ms)[0m  [1mINSERT INTO "chapter_versions" ("chapter_id", "version", "title", "body", "book_id", "created_at", "updated_at") VALUES (2, 3, 'different title again', 'Ligeti woke up with a throbbing headache...', NULL, '2010-12-15 03:47:42.578755', '2010-12-15 03:48:41.299338')[0m
  [1m[35mSQL (0.5ms)[0m  SELECT COUNT(*) FROM "chapter_versions" WHERE ("chapter_versions".chapter_id = 2)
  [1m[36mChapter::Version Load (0.6ms)[0m  [1mSELECT "chapter_versions".* FROM "chapter_versions" WHERE ("chapter_versions".chapter_id = 2) AND ("chapter_versions"."version" = 1) LIMIT 1[0m
  [1m[35mAREL (0.5ms)[0m  UPDATE "chapters" SET "title" = 'The Next Day', "updated_at" = '2010-12-15 03:47:42.578755', "version" = 1 WHERE ("chapters"."id" = 2)
  [1m[36mSQL (0.5ms)[0m  [1mSELECT COUNT(*) FROM "chapter_versions" WHERE ("chapter_versions".chapter_id = 2)[0m
  [1m[35mAREL (0.7ms)[0m  INSERT INTO "chapters" ("title", "body", "version", "book_id", "created_at", "updated_at") VALUES ('The Next Day', 'Liget woke up with a throbbing headache...', 1, NULL, '2010-12-15 17:26:40.406049', '2010-12-15 17:26:40.406049')
  [1m[36mAREL (0.2ms)[0m  [1mINSERT INTO "chapter_versions" ("chapter_id", "version", "title", "body", "book_id", "created_at", "updated_at") VALUES (3, 1, 'The Next Day', 'Liget woke up with a throbbing headache...', NULL, '2010-12-15 17:26:40.406049', '2010-12-15 17:26:40.406049')[0m
  [1m[35mSQL (0.4ms)[0m  SELECT MAX("chapter_versions"."version") AS max_id FROM "chapter_versions" WHERE ("chapter_versions".chapter_id = 3)
  [1m[36mAREL (0.3ms)[0m  [1mUPDATE "chapters" SET "title" = 'different title', "version" = 2, "updated_at" = '2010-12-15 17:26:53.943220' WHERE ("chapters"."id" = 3)[0m
  [1m[35mAREL (0.2ms)[0m  INSERT INTO "chapter_versions" ("chapter_id", "version", "title", "body", "book_id", "created_at", "updated_at") VALUES (3, 2, 'different title', 'Liget woke up with a throbbing headache...', NULL, '2010-12-15 17:26:40.406049', '2010-12-15 17:26:53.943220')
  [1m[36mSQL (0.4ms)[0m  [1mSELECT COUNT(*) FROM "chapter_versions" WHERE ("chapter_versions".chapter_id = 3)[0m
  [1m[35mAREL (0.6ms)[0m  UPDATE "chapters" SET "title" = 'The Previous Day', "updated_at" = '2010-12-15 17:27:12.766011' WHERE ("chapters"."id" = 3)
  [1m[36mSQL (0.4ms)[0m  [1mSELECT COUNT(*) FROM "chapter_versions" WHERE ("chapter_versions".chapter_id = 3)[0m
  [1m[35mChapter::Version Load (1.9ms)[0m  SELECT "chapter_versions".* FROM "chapter_versions"
