· 8 years ago · Mar 02, 2018, 12:56 PM
1DROP TABLE IF EXISTS "comments"
2PRAGMA table_info('comments')
3SELECT sqlite_version(*)
4CREATE TABLE "comments" ("id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "commentable_type" VARCHAR(50), "commentable_id" INTEGER, "text" TEXT)
5DROP TABLE IF EXISTS "posts"
6PRAGMA table_info('posts')
7CREATE TABLE "posts" ("id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "title" VARCHAR(50))
8DROP TABLE IF EXISTS "notes"
9PRAGMA table_info('notes')
10CREATE TABLE "notes" ("id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "title" VARCHAR(50))
11INSERT INTO "posts" ("title") VALUES ('My first blog post!')
12INSERT INTO "notes" ("title") VALUES ('My first notebook note!')
13SELECT "id", "commentable_type", "commentable_id" FROM "comments" WHERE ("commentable_id" IN (1)) AND ("commentable_type" = 'Post') ORDER BY "id"
14INSERT INTO "comments" ("commentable_type", "text", "commentable_id") VALUES ('Post', 'Click here for cheap viagra', 1)
15SELECT "id", "commentable_type", "commentable_id" FROM "comments" WHERE ("commentable_id" IN (1)) AND ("commentable_type" = 'Note') ORDER BY "id"
16INSERT INTO "comments" ("commentable_id", "commentable_type", "text") VALUES (1, 'Note', 'Click here for even more cheap viagra')
17INSERT INTO "comments" ("commentable_type", "text", "commentable_id") VALUES ('Post', 'Click here for cheap viagra 1', 1)
18INSERT INTO "comments" ("commentable_type", "text", "commentable_id") VALUES ('Post', 'Click here for cheap viagra 2', 1)
19INSERT INTO "comments" ("commentable_type", "text", "commentable_id") VALUES ('Post', 'Click here for cheap viagra 3', 1)
20INSERT INTO "comments" ("commentable_type", "text", "commentable_id") VALUES ('Post', 'Click here for cheap viagra 4', 1)
21INSERT INTO "comments" ("commentable_type", "text", "commentable_id") VALUES ('Post', 'Click here for cheap viagra 5', 1)
22SELECT "id", "title" FROM "posts" WHERE ("id" IN (1)) ORDER BY "id"
23SELECT "id", "title" FROM "posts" WHERE ("id" IN (1)) ORDER BY "id"
24SELECT "id", "title" FROM "posts" WHERE ("id" IN (1)) ORDER BY "id"
25SELECT "id", "title" FROM "posts" WHERE ("id" IN (1)) ORDER BY "id"
26SELECT "id", "title" FROM "posts" WHERE ("id" IN (1)) ORDER BY "id"
27SELECT "id", "title" FROM "posts" WHERE ("id" IN (1)) ORDER BY "id"
28SELECT "id", "title" FROM "posts" WHERE ("id" = 1) ORDER BY "id"
29SELECT "id", "commentable_type", "commentable_id" FROM "comments" WHERE ("commentable_id" IN (1)) AND ("commentable_type" = 'Post') ORDER BY "id"