質問編集履歴

3

2019/06/07 04:51

投稿

jgrialgj
jgrialgj

スコア8

test CHANGED
File without changes
test CHANGED
@@ -82,4 +82,4 @@
82
82
 
83
83
 
84
84
 
85
- テーブルの構成も異常がないように思えますがなんで回答者さんが指摘して下さったようにfollower_idが入っていないんでしょうか
85
+ テーブルの構成も異常がないように思えますがなんで回答者さんが指摘して下さったようにfollower_idが入っていないんでしょうか

2

追記

2019/06/07 04:51

投稿

jgrialgj
jgrialgj

スコア8

test CHANGED
File without changes
test CHANGED
@@ -82,4 +82,4 @@
82
82
 
83
83
 
84
84
 
85
- テーブルの構成も異常がないように思えます
85
+ テーブルの構成も異常がないように思えますがなんで回答者さんが指摘して下さったようにfollower_idが入っていないんでしょうか

1

追記

2019/06/06 11:43

投稿

jgrialgj
jgrialgj

スコア8

test CHANGED
File without changes
test CHANGED
@@ -39,3 +39,47 @@
39
39
 
40
40
 
41
41
  ```
42
+
43
+
44
+
45
+ Relationhipsのテーブルをrails:dbで確認しました。
46
+
47
+
48
+
49
+ ```
50
+
51
+ $ rails db
52
+
53
+ SQLite version 3.19.3 2017-06-27 16:48:08
54
+
55
+ Enter ".help" for usage hints.
56
+
57
+ sqlite> .table
58
+
59
+ ar_internal_metadata photos schema_migrations
60
+
61
+ comments posts users
62
+
63
+ likes relationships
64
+
65
+ sqlite> .schema relationsships
66
+
67
+ sqlite> .schema relationships
68
+
69
+ CREATE TABLE IF NOT EXISTS "relationships" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "follower_id" integer, "followed_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL);
70
+
71
+ CREATE INDEX "index_relationships_on_follower_id" ON "relationships" ("follower_id");
72
+
73
+ CREATE INDEX "index_relationships_on_followed_id" ON "relationships" ("followed_id");
74
+
75
+ CREATE UNIQUE INDEX "index_relationships_on_follower_id_and_followed_id" ON "relationships" ("follower_id", "followed_id");
76
+
77
+ sqlite>
78
+
79
+
80
+
81
+ ```
82
+
83
+
84
+
85
+ テーブルの構成も異常がないように思えます。