Skip to content

Instantly share code, notes, and snippets.

@timwaters
Created June 1, 2015 18:44
Show Gist options
  • Save timwaters/e26b4e2ae0583b3fc5a8 to your computer and use it in GitHub Desktop.
Save timwaters/e26b4e2ae0583b3fc5a8 to your computer and use it in GitHub Desktop.
tail -f log/test.log -n 1000
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
(0.2ms) begin transaction
SQL (0.4ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["title", "first"], ["text", "text stuff"], ["created_at", "2015-06-01 18:44:00.613696"], ["updated_at", "2015-06-01 18:44:00.613696"]]
SQL (0.3ms) INSERT INTO "versions" ("event", "created_at", "item_id", "item_type") VALUES (?, ?, ?, ?) [["event", "create"], ["created_at", "2015-06-01 18:44:00.613696"], ["item_id", 980191009], ["item_type", "Article"]]
SQL (0.4ms) UPDATE "versions" SET "transaction_id" = ? WHERE "versions"."id" = ? [["transaction_id", 213], ["id", 213]]
(234.3ms) commit transaction
(0.1ms) begin transaction
SQL (0.3ms) INSERT INTO "comments" ("text", "article_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "this is a comment"], ["article_id", 980191009], ["created_at", "2015-06-01 18:44:00.897381"], ["updated_at", "2015-06-01 18:44:00.897381"]]
SQL (0.2ms) INSERT INTO "versions" ("event", "created_at", "item_id", "item_type") VALUES (?, ?, ?, ?) [["event", "create"], ["created_at", "2015-06-01 18:44:00.897381"], ["item_id", 980191009], ["item_type", "Comment"]]
SQL (0.1ms) UPDATE "versions" SET "transaction_id" = ? WHERE "versions"."id" = ? [["transaction_id", 214], ["id", 214]]
SQL (0.3ms) INSERT INTO "version_associations" ("version_id", "foreign_key_name", "foreign_key_id") VALUES (?, ?, ?) [["version_id", 214], ["foreign_key_name", "article_id"], ["foreign_key_id", 980191009]]
SQL (0.1ms) UPDATE "articles" SET "updated_at" = ? WHERE "articles"."id" = ? [["updated_at", "2015-06-01 18:44:00.908773"], ["id", 980191009]]
SQL (0.2ms) INSERT INTO "versions" ("event", "object", "created_at", "transaction_id", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980191009\ntitle: first\ntext: text stuff\ncreated_at: &1 2015-06-01 18:44:00.613696796 Z\nupdated_at: *1\n"], ["created_at", "2015-06-01 18:44:00.908773"], ["transaction_id", 214], ["item_id", 980191009], ["item_type", "Article"]]
(196.1ms) commit transaction
Comment Load (0.3ms) SELECT "comments".* FROM "comments" ORDER BY "comments"."id" DESC LIMIT 1
(0.1ms) begin transaction
SQL (0.4ms) UPDATE "comments" SET "text" = ?, "updated_at" = ? WHERE "comments"."id" = ? [["text", "changed"], ["updated_at", "2015-06-01 18:44:01.115056"], ["id", 980191009]]
SQL (0.3ms) INSERT INTO "versions" ("event", "object", "created_at", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980191009\ntext: this is a comment\narticle_id: 980191009\ncreated_at: 2015-06-01 18:44:00.897381000 Z\nupdated_at: 2015-06-01 18:44:00.897381000 Z\n"], ["created_at", "2015-06-01 18:44:01.115056"], ["item_id", 980191009], ["item_type", "Comment"]]
SQL (0.2ms) UPDATE "versions" SET "transaction_id" = ? WHERE "versions"."id" = ? [["transaction_id", 216], ["id", 216]]
SQL (0.1ms) INSERT INTO "version_associations" ("version_id", "foreign_key_name", "foreign_key_id") VALUES (?, ?, ?) [["version_id", 216], ["foreign_key_name", "article_id"], ["foreign_key_id", 980191009]]
Article Load (0.2ms) SELECT "articles".* FROM "articles" WHERE "articles"."id" = ? LIMIT 1 [["id", 980191009]]
SQL (0.1ms) UPDATE "articles" SET "updated_at" = ? WHERE "articles"."id" = ? [["updated_at", "2015-06-01 18:44:01.127233"], ["id", 980191009]]
SQL (0.1ms) INSERT INTO "versions" ("event", "object", "created_at", "transaction_id", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980191009\ntitle: first\ntext: text stuff\ncreated_at: 2015-06-01 18:44:00.613696000 Z\nupdated_at: 2015-06-01 18:44:00.908773000 Z\n"], ["created_at", "2015-06-01 18:44:01.127233"], ["transaction_id", 216], ["item_id", 980191009], ["item_type", "Article"]]
(231.1ms) commit transaction
Article Load (0.3ms) SELECT "articles".* FROM "articles" ORDER BY "articles"."id" DESC LIMIT 1
Article Load (0.1ms) SELECT "articles".* FROM "articles" WHERE "articles"."id" = ? LIMIT 1 [["id", 980191009]]
PaperTrail::Version Load (0.4ms) SELECT "versions".* FROM "versions" WHERE "versions"."item_id" = ? AND "versions"."item_type" = ? ORDER BY "versions"."created_at" DESC, "versions"."id" DESC LIMIT 1 [["item_id", 980191009], ["item_type", "Article"]]
Article Load (0.3ms) SELECT "articles".* FROM "articles" WHERE "articles"."id" = ? LIMIT 1 [["id", 980191009]]
PaperTrail::Version Load (0.4ms) SELECT "versions".* FROM "versions" WHERE (id IN (SELECT MIN(version_id) FROM "version_associations" INNER JOIN "versions" ON "versions"."id" = "version_associations"."version_id" WHERE (foreign_key_name = 'article_id') AND (foreign_key_id = 980191009) AND (versions.item_type = 'Comment') AND (created_at >= '2015-06-01 18:44:01.127233' OR transaction_id = 216) GROUP BY item_id))
Comment Load (0.1ms) SELECT "comments".* FROM "comments" WHERE "comments"."article_id" = ? [["article_id", 980191009]]
Comment Load (0.1ms) SELECT "comments".* FROM "comments" WHERE "comments"."id" = ? LIMIT 1 [["id", 980191009]]
(0.1ms) begin transaction
Fixture Delete (0.2ms) DELETE FROM "comments"
Fixture Insert (0.1ms) INSERT INTO "comments" ("text", "created_at", "updated_at", "id") VALUES ('MyText', '2015-06-01 18:44:01', '2015-06-01 18:44:01', 980190962)
Fixture Insert (0.1ms) INSERT INTO "comments" ("text", "created_at", "updated_at", "id") VALUES ('MyText', '2015-06-01 18:44:01', '2015-06-01 18:44:01', 298486374)
Fixture Delete (0.1ms) DELETE FROM "articles"
Fixture Insert (0.1ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-06-01 18:44:01', '2015-06-01 18:44:01', 980190962)
Fixture Insert (0.1ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-06-01 18:44:01', '2015-06-01 18:44:01', 298486374)
(189.9ms) commit transaction
(0.1ms) begin transaction
------------------------------------
ArticleTest: test_adding_versioning_
------------------------------------
(0.1ms) SAVEPOINT active_record_1
SQL (0.2ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["title", "first"], ["text", "text stuff"], ["created_at", "2015-06-01 18:44:01.612850"], ["updated_at", "2015-06-01 18:44:01.612850"]]
SQL (0.2ms) INSERT INTO "versions" ("event", "created_at", "item_id", "item_type") VALUES (?, ?, ?, ?) [["event", "create"], ["created_at", "2015-06-01 18:44:01.612850"], ["item_id", 980191010], ["item_type", "Article"]]
SQL (0.2ms) UPDATE "versions" SET "transaction_id" = ? WHERE "versions"."id" = ? [["transaction_id", 218], ["id", 218]]
(0.1ms) RELEASE SAVEPOINT active_record_1
(0.1ms) SAVEPOINT active_record_1
SQL (0.1ms) INSERT INTO "comments" ("text", "article_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "this is a comment"], ["article_id", 980191010], ["created_at", "2015-06-01 18:44:01.622124"], ["updated_at", "2015-06-01 18:44:01.622124"]]
SQL (0.3ms) INSERT INTO "versions" ("event", "created_at", "transaction_id", "item_id", "item_type") VALUES (?, ?, ?, ?, ?) [["event", "create"], ["created_at", "2015-06-01 18:44:01.622124"], ["transaction_id", 218], ["item_id", 980191010], ["item_type", "Comment"]]
SQL (0.1ms) INSERT INTO "version_associations" ("version_id", "foreign_key_name", "foreign_key_id") VALUES (?, ?, ?) [["version_id", 219], ["foreign_key_name", "article_id"], ["foreign_key_id", 980191010]]
SQL (0.1ms) UPDATE "articles" SET "updated_at" = ? WHERE "articles"."id" = ? [["updated_at", "2015-06-01 18:44:01.630705"], ["id", 980191010]]
SQL (0.6ms) INSERT INTO "versions" ("event", "object", "created_at", "transaction_id", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980191010\ntitle: first\ntext: text stuff\ncreated_at: &1 2015-06-01 18:44:01.612850417 Z\nupdated_at: *1\n"], ["created_at", "2015-06-01 18:44:01.630705"], ["transaction_id", 218], ["item_id", 980191010], ["item_type", "Article"]]
(0.1ms) RELEASE SAVEPOINT active_record_1
Comment Load (0.7ms) SELECT "comments".* FROM "comments" ORDER BY "comments"."id" DESC LIMIT 1
(0.0ms) SAVEPOINT active_record_1
SQL (0.1ms) UPDATE "comments" SET "text" = ?, "updated_at" = ? WHERE "comments"."id" = ? [["text", "changed"], ["updated_at", "2015-06-01 18:44:01.640190"], ["id", 980191010]]
SQL (0.1ms) INSERT INTO "versions" ("event", "object", "created_at", "transaction_id", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980191010\ntext: this is a comment\narticle_id: 980191010\ncreated_at: 2015-06-01 18:44:01.622124000 Z\nupdated_at: 2015-06-01 18:44:01.622124000 Z\n"], ["created_at", "2015-06-01 18:44:01.640190"], ["transaction_id", 218], ["item_id", 980191010], ["item_type", "Comment"]]
SQL (0.1ms) INSERT INTO "version_associations" ("version_id", "foreign_key_name", "foreign_key_id") VALUES (?, ?, ?) [["version_id", 221], ["foreign_key_name", "article_id"], ["foreign_key_id", 980191010]]
Article Load (0.1ms) SELECT "articles".* FROM "articles" WHERE "articles"."id" = ? LIMIT 1 [["id", 980191010]]
SQL (0.1ms) UPDATE "articles" SET "updated_at" = ? WHERE "articles"."id" = ? [["updated_at", "2015-06-01 18:44:01.648704"], ["id", 980191010]]
SQL (0.2ms) INSERT INTO "versions" ("event", "object", "created_at", "transaction_id", "item_id", "item_type") VALUES (?, ?, ?, ?, ?, ?) [["event", "update"], ["object", "---\nid: 980191010\ntitle: first\ntext: text stuff\ncreated_at: 2015-06-01 18:44:01.612850000 Z\nupdated_at: 2015-06-01 18:44:01.630705000 Z\n"], ["created_at", "2015-06-01 18:44:01.648704"], ["transaction_id", 218], ["item_id", 980191010], ["item_type", "Article"]]
(0.1ms) RELEASE SAVEPOINT active_record_1
Article Load (0.1ms) SELECT "articles".* FROM "articles" ORDER BY "articles"."id" DESC LIMIT 1
Article Load (0.0ms) SELECT "articles".* FROM "articles" WHERE "articles"."id" = ? LIMIT 1 [["id", 980191010]]
PaperTrail::Version Load (0.1ms) SELECT "versions".* FROM "versions" WHERE "versions"."item_id" = ? AND "versions"."item_type" = ? ORDER BY "versions"."created_at" DESC, "versions"."id" DESC LIMIT 1 [["item_id", 980191010], ["item_type", "Article"]]
Article Load (0.0ms) SELECT "articles".* FROM "articles" WHERE "articles"."id" = ? LIMIT 1 [["id", 980191010]]
PaperTrail::Version Load (0.2ms) SELECT "versions".* FROM "versions" WHERE (id IN (SELECT MIN(version_id) FROM "version_associations" INNER JOIN "versions" ON "versions"."id" = "version_associations"."version_id" WHERE (foreign_key_name = 'article_id') AND (foreign_key_id = 980191010) AND (versions.item_type = 'Comment') AND (created_at >= '2015-06-01 18:44:01.648704' OR transaction_id = 218) GROUP BY item_id))
Comment Load (0.0ms) SELECT "comments".* FROM "comments" WHERE "comments"."article_id" = ? [["article_id", 980191010]]
(0.2ms) rollback transaction
PaperTrail::Version Load (0.1ms) SELECT "versions".* FROM "versions" WHERE "versions"."item_id" = ? AND "versions"."item_type" = ? ORDER BY "versions"."created_at" ASC, "versions"."id" ASC [["item_id", 980191010], ["item_type", "Article"]]
PaperTrail::Version Load (0.1ms) SELECT "versions".* FROM "versions" WHERE "versions"."item_id" = ? AND "versions"."item_type" = ? ORDER BY "versions"."created_at" ASC, "versions"."id" ASC [["item_id", 980191010], ["item_type", "Comment"]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment