|
194 | 194 | t.integer "avatar_storage_schema_version" |
195 | 195 | t.integer "header_storage_schema_version" |
196 | 196 | t.string "devices_url" |
197 | | - t.integer "suspension_origin" |
198 | 197 | t.datetime "sensitized_at", precision: nil |
| 198 | + t.integer "suspension_origin" |
199 | 199 | t.boolean "trendable" |
200 | 200 | t.datetime "reviewed_at", precision: nil |
201 | 201 | t.datetime "requested_review_at", precision: nil |
|
579 | 579 | end |
580 | 580 |
|
581 | 581 | create_table "ip_blocks", force: :cascade do |t| |
582 | | - t.datetime "created_at", precision: nil, null: false |
583 | | - t.datetime "updated_at", precision: nil, null: false |
584 | | - t.datetime "expires_at", precision: nil |
585 | 582 | t.inet "ip", default: "0.0.0.0", null: false |
586 | 583 | t.integer "severity", default: 0, null: false |
| 584 | + t.datetime "expires_at", precision: nil |
587 | 585 | t.text "comment", default: "", null: false |
| 586 | + t.datetime "created_at", precision: nil, null: false |
| 587 | + t.datetime "updated_at", precision: nil, null: false |
588 | 588 | t.index ["ip"], name: "index_ip_blocks_on_ip", unique: true |
589 | 589 | end |
590 | 590 |
|
|
1421 | 1421 | add_index "instances", ["domain"], name: "index_instances_on_domain", unique: true |
1422 | 1422 |
|
1423 | 1423 | create_view "user_ips", sql_definition: <<-SQL |
1424 | | - SELECT t0.user_id, |
1425 | | - t0.ip, |
1426 | | - max(t0.used_at) AS used_at |
| 1424 | + SELECT user_id, |
| 1425 | + ip, |
| 1426 | + max(used_at) AS used_at |
1427 | 1427 | FROM ( SELECT users.id AS user_id, |
1428 | 1428 | users.sign_up_ip AS ip, |
1429 | 1429 | users.created_at AS used_at |
|
1440 | 1440 | login_activities.created_at |
1441 | 1441 | FROM login_activities |
1442 | 1442 | WHERE (login_activities.success = true)) t0 |
1443 | | - GROUP BY t0.user_id, t0.ip; |
| 1443 | + GROUP BY user_id, ip; |
1444 | 1444 | SQL |
1445 | 1445 | create_view "account_summaries", materialized: true, sql_definition: <<-SQL |
1446 | 1446 | SELECT accounts.id AS account_id, |
|
1461 | 1461 | add_index "account_summaries", ["account_id"], name: "index_account_summaries_on_account_id", unique: true |
1462 | 1462 |
|
1463 | 1463 | create_view "global_follow_recommendations", materialized: true, sql_definition: <<-SQL |
1464 | | - SELECT t0.account_id, |
1465 | | - sum(t0.rank) AS rank, |
1466 | | - array_agg(t0.reason) AS reason |
| 1464 | + SELECT account_id, |
| 1465 | + sum(rank) AS rank, |
| 1466 | + array_agg(reason) AS reason |
1467 | 1467 | FROM ( SELECT account_summaries.account_id, |
1468 | 1468 | ((count(follows.id))::numeric / (1.0 + (count(follows.id))::numeric)) AS rank, |
1469 | 1469 | 'most_followed'::text AS reason |
|
1487 | 1487 | WHERE (follow_recommendation_suppressions.account_id = statuses.account_id))))) |
1488 | 1488 | GROUP BY account_summaries.account_id |
1489 | 1489 | HAVING (sum((status_stats.reblogs_count + status_stats.favourites_count)) >= (5)::numeric)) t0 |
1490 | | - GROUP BY t0.account_id |
1491 | | - ORDER BY (sum(t0.rank)) DESC; |
| 1490 | + GROUP BY account_id |
| 1491 | + ORDER BY (sum(rank)) DESC; |
1492 | 1492 | SQL |
1493 | 1493 | add_index "global_follow_recommendations", ["account_id"], name: "index_global_follow_recommendations_on_account_id", unique: true |
1494 | 1494 |
|
|
0 commit comments