schema.rb 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997
  1. # This file is auto-generated from the current state of the database. Instead
  2. # of editing this file, please use the migrations feature of Active Record to
  3. # incrementally modify your database, and then regenerate this schema definition.
  4. #
  5. # Note that this schema.rb definition is the authoritative source for your
  6. # database schema. If you need to create the application database on another
  7. # system, you should be using db:schema:load, not running all the migrations
  8. # from scratch. The latter is a flawed and unsustainable approach (the more migrations
  9. # you'll amass, the slower it'll run and the greater likelihood for issues).
  10. #
  11. # It's strongly recommended that you check this file into your version control system.
  12. ActiveRecord::Schema.define(version: 2020_06_05_155027) do
  13. # These are extensions that must be enabled in order to support this database
  14. enable_extension "plpgsql"
  15. create_table "account_aliases", force: :cascade do |t|
  16. t.bigint "account_id"
  17. t.string "acct", default: "", null: false
  18. t.string "uri", default: "", null: false
  19. t.datetime "created_at", null: false
  20. t.datetime "updated_at", null: false
  21. t.index ["account_id"], name: "index_account_aliases_on_account_id"
  22. end
  23. create_table "account_conversations", force: :cascade do |t|
  24. t.bigint "account_id"
  25. t.bigint "conversation_id"
  26. t.bigint "participant_account_ids", default: [], null: false, array: true
  27. t.bigint "status_ids", default: [], null: false, array: true
  28. t.bigint "last_status_id"
  29. t.integer "lock_version", default: 0, null: false
  30. t.boolean "unread", default: false, null: false
  31. t.index ["account_id", "conversation_id", "participant_account_ids"], name: "index_unique_conversations", unique: true
  32. t.index ["account_id"], name: "index_account_conversations_on_account_id"
  33. t.index ["conversation_id"], name: "index_account_conversations_on_conversation_id"
  34. end
  35. create_table "account_domain_blocks", force: :cascade do |t|
  36. t.string "domain"
  37. t.datetime "created_at", null: false
  38. t.datetime "updated_at", null: false
  39. t.bigint "account_id"
  40. t.index ["account_id", "domain"], name: "index_account_domain_blocks_on_account_id_and_domain", unique: true
  41. end
  42. create_table "account_identity_proofs", force: :cascade do |t|
  43. t.bigint "account_id"
  44. t.string "provider", default: "", null: false
  45. t.string "provider_username", default: "", null: false
  46. t.text "token", default: "", null: false
  47. t.boolean "verified", default: false, null: false
  48. t.boolean "live", default: false, null: false
  49. t.datetime "created_at", null: false
  50. t.datetime "updated_at", null: false
  51. t.index ["account_id", "provider", "provider_username"], name: "index_account_proofs_on_account_and_provider_and_username", unique: true
  52. t.index ["account_id"], name: "index_account_identity_proofs_on_account_id"
  53. end
  54. create_table "account_migrations", force: :cascade do |t|
  55. t.bigint "account_id"
  56. t.string "acct", default: "", null: false
  57. t.bigint "followers_count", default: 0, null: false
  58. t.bigint "target_account_id"
  59. t.datetime "created_at", null: false
  60. t.datetime "updated_at", null: false
  61. t.index ["account_id"], name: "index_account_migrations_on_account_id"
  62. t.index ["target_account_id"], name: "index_account_migrations_on_target_account_id"
  63. end
  64. create_table "account_moderation_notes", force: :cascade do |t|
  65. t.text "content", null: false
  66. t.bigint "account_id", null: false
  67. t.bigint "target_account_id", null: false
  68. t.datetime "created_at", null: false
  69. t.datetime "updated_at", null: false
  70. t.index ["account_id"], name: "index_account_moderation_notes_on_account_id"
  71. t.index ["target_account_id"], name: "index_account_moderation_notes_on_target_account_id"
  72. end
  73. create_table "account_pins", force: :cascade do |t|
  74. t.bigint "account_id"
  75. t.bigint "target_account_id"
  76. t.datetime "created_at", null: false
  77. t.datetime "updated_at", null: false
  78. t.index ["account_id", "target_account_id"], name: "index_account_pins_on_account_id_and_target_account_id", unique: true
  79. t.index ["account_id"], name: "index_account_pins_on_account_id"
  80. t.index ["target_account_id"], name: "index_account_pins_on_target_account_id"
  81. end
  82. create_table "account_stats", force: :cascade do |t|
  83. t.bigint "account_id", null: false
  84. t.bigint "statuses_count", default: 0, null: false
  85. t.bigint "following_count", default: 0, null: false
  86. t.bigint "followers_count", default: 0, null: false
  87. t.datetime "created_at", null: false
  88. t.datetime "updated_at", null: false
  89. t.datetime "last_status_at"
  90. t.integer "lock_version", default: 0, null: false
  91. t.index ["account_id"], name: "index_account_stats_on_account_id", unique: true
  92. end
  93. create_table "account_tag_stats", force: :cascade do |t|
  94. t.bigint "tag_id", null: false
  95. t.bigint "accounts_count", default: 0, null: false
  96. t.boolean "hidden", default: false, null: false
  97. t.datetime "created_at", null: false
  98. t.datetime "updated_at", null: false
  99. t.index ["tag_id"], name: "index_account_tag_stats_on_tag_id", unique: true
  100. end
  101. create_table "account_warning_presets", force: :cascade do |t|
  102. t.text "text", default: "", null: false
  103. t.datetime "created_at", null: false
  104. t.datetime "updated_at", null: false
  105. t.string "title", default: "", null: false
  106. end
  107. create_table "account_warnings", force: :cascade do |t|
  108. t.bigint "account_id"
  109. t.bigint "target_account_id"
  110. t.integer "action", default: 0, null: false
  111. t.text "text", default: "", null: false
  112. t.datetime "created_at", null: false
  113. t.datetime "updated_at", null: false
  114. t.index ["account_id"], name: "index_account_warnings_on_account_id"
  115. t.index ["target_account_id"], name: "index_account_warnings_on_target_account_id"
  116. end
  117. create_table "accounts", force: :cascade do |t|
  118. t.string "username", default: "", null: false
  119. t.string "domain"
  120. t.string "secret", default: "", null: false
  121. t.text "private_key"
  122. t.text "public_key", default: "", null: false
  123. t.string "remote_url", default: "", null: false
  124. t.string "salmon_url", default: "", null: false
  125. t.string "hub_url", default: "", null: false
  126. t.datetime "created_at", null: false
  127. t.datetime "updated_at", null: false
  128. t.text "note", default: "", null: false
  129. t.string "display_name", default: "", null: false
  130. t.string "uri", default: "", null: false
  131. t.string "url"
  132. t.string "avatar_file_name"
  133. t.string "avatar_content_type"
  134. t.integer "avatar_file_size"
  135. t.datetime "avatar_updated_at"
  136. t.string "header_file_name"
  137. t.string "header_content_type"
  138. t.integer "header_file_size"
  139. t.datetime "header_updated_at"
  140. t.string "avatar_remote_url"
  141. t.datetime "subscription_expires_at"
  142. t.boolean "locked", default: false, null: false
  143. t.string "header_remote_url", default: "", null: false
  144. t.datetime "last_webfingered_at"
  145. t.string "inbox_url", default: "", null: false
  146. t.string "outbox_url", default: "", null: false
  147. t.string "shared_inbox_url", default: "", null: false
  148. t.string "followers_url", default: "", null: false
  149. t.integer "protocol", default: 0, null: false
  150. t.boolean "memorial", default: false, null: false
  151. t.bigint "moved_to_account_id"
  152. t.string "featured_collection_url"
  153. t.jsonb "fields"
  154. t.string "actor_type"
  155. t.boolean "discoverable"
  156. t.string "also_known_as", array: true
  157. t.datetime "silenced_at"
  158. t.datetime "suspended_at"
  159. t.integer "trust_level"
  160. t.boolean "hide_collections"
  161. t.integer "avatar_storage_schema_version"
  162. t.integer "header_storage_schema_version"
  163. t.string "devices_url"
  164. t.index "(((setweight(to_tsvector('simple'::regconfig, (display_name)::text), 'A'::\"char\") || setweight(to_tsvector('simple'::regconfig, (username)::text), 'B'::\"char\")) || setweight(to_tsvector('simple'::regconfig, (COALESCE(domain, ''::character varying))::text), 'C'::\"char\")))", name: "search_index", using: :gin
  165. t.index "lower((username)::text), lower((domain)::text)", name: "index_accounts_on_username_and_domain_lower", unique: true
  166. t.index ["moved_to_account_id"], name: "index_accounts_on_moved_to_account_id"
  167. t.index ["uri"], name: "index_accounts_on_uri"
  168. t.index ["url"], name: "index_accounts_on_url"
  169. end
  170. create_table "accounts_tags", id: false, force: :cascade do |t|
  171. t.bigint "account_id", null: false
  172. t.bigint "tag_id", null: false
  173. t.index ["account_id", "tag_id"], name: "index_accounts_tags_on_account_id_and_tag_id"
  174. t.index ["tag_id", "account_id"], name: "index_accounts_tags_on_tag_id_and_account_id", unique: true
  175. end
  176. create_table "admin_action_logs", force: :cascade do |t|
  177. t.bigint "account_id"
  178. t.string "action", default: "", null: false
  179. t.string "target_type"
  180. t.bigint "target_id"
  181. t.text "recorded_changes", default: "", null: false
  182. t.datetime "created_at", null: false
  183. t.datetime "updated_at", null: false
  184. t.index ["account_id"], name: "index_admin_action_logs_on_account_id"
  185. t.index ["target_type", "target_id"], name: "index_admin_action_logs_on_target_type_and_target_id"
  186. end
  187. create_table "announcement_mutes", force: :cascade do |t|
  188. t.bigint "account_id"
  189. t.bigint "announcement_id"
  190. t.datetime "created_at", null: false
  191. t.datetime "updated_at", null: false
  192. t.index ["account_id", "announcement_id"], name: "index_announcement_mutes_on_account_id_and_announcement_id", unique: true
  193. t.index ["account_id"], name: "index_announcement_mutes_on_account_id"
  194. t.index ["announcement_id"], name: "index_announcement_mutes_on_announcement_id"
  195. end
  196. create_table "announcement_reactions", force: :cascade do |t|
  197. t.bigint "account_id"
  198. t.bigint "announcement_id"
  199. t.string "name", default: "", null: false
  200. t.bigint "custom_emoji_id"
  201. t.datetime "created_at", null: false
  202. t.datetime "updated_at", null: false
  203. t.index ["account_id", "announcement_id", "name"], name: "index_announcement_reactions_on_account_id_and_announcement_id", unique: true
  204. t.index ["account_id"], name: "index_announcement_reactions_on_account_id"
  205. t.index ["announcement_id"], name: "index_announcement_reactions_on_announcement_id"
  206. t.index ["custom_emoji_id"], name: "index_announcement_reactions_on_custom_emoji_id"
  207. end
  208. create_table "announcements", force: :cascade do |t|
  209. t.text "text", default: "", null: false
  210. t.boolean "published", default: false, null: false
  211. t.boolean "all_day", default: false, null: false
  212. t.datetime "scheduled_at"
  213. t.datetime "starts_at"
  214. t.datetime "ends_at"
  215. t.datetime "created_at", null: false
  216. t.datetime "updated_at", null: false
  217. t.datetime "published_at"
  218. t.bigint "status_ids", array: true
  219. end
  220. create_table "backups", force: :cascade do |t|
  221. t.bigint "user_id"
  222. t.string "dump_file_name"
  223. t.string "dump_content_type"
  224. t.datetime "dump_updated_at"
  225. t.boolean "processed", default: false, null: false
  226. t.datetime "created_at", null: false
  227. t.datetime "updated_at", null: false
  228. t.bigint "dump_file_size"
  229. end
  230. create_table "blocks", force: :cascade do |t|
  231. t.datetime "created_at", null: false
  232. t.datetime "updated_at", null: false
  233. t.bigint "account_id", null: false
  234. t.bigint "target_account_id", null: false
  235. t.string "uri"
  236. t.index ["account_id", "target_account_id"], name: "index_blocks_on_account_id_and_target_account_id", unique: true
  237. t.index ["target_account_id"], name: "index_blocks_on_target_account_id"
  238. end
  239. create_table "bookmarks", force: :cascade do |t|
  240. t.bigint "account_id", null: false
  241. t.bigint "status_id", null: false
  242. t.datetime "created_at", null: false
  243. t.datetime "updated_at", null: false
  244. t.index ["account_id", "status_id"], name: "index_bookmarks_on_account_id_and_status_id", unique: true
  245. t.index ["account_id"], name: "index_bookmarks_on_account_id"
  246. t.index ["status_id"], name: "index_bookmarks_on_status_id"
  247. end
  248. create_table "conversation_mutes", force: :cascade do |t|
  249. t.bigint "conversation_id", null: false
  250. t.bigint "account_id", null: false
  251. t.index ["account_id", "conversation_id"], name: "index_conversation_mutes_on_account_id_and_conversation_id", unique: true
  252. end
  253. create_table "conversations", force: :cascade do |t|
  254. t.string "uri"
  255. t.datetime "created_at", null: false
  256. t.datetime "updated_at", null: false
  257. t.index ["uri"], name: "index_conversations_on_uri", unique: true
  258. end
  259. create_table "custom_emoji_categories", force: :cascade do |t|
  260. t.string "name"
  261. t.datetime "created_at", null: false
  262. t.datetime "updated_at", null: false
  263. t.index ["name"], name: "index_custom_emoji_categories_on_name", unique: true
  264. end
  265. create_table "custom_emojis", force: :cascade do |t|
  266. t.string "shortcode", default: "", null: false
  267. t.string "domain"
  268. t.string "image_file_name"
  269. t.string "image_content_type"
  270. t.integer "image_file_size"
  271. t.datetime "image_updated_at"
  272. t.datetime "created_at", null: false
  273. t.datetime "updated_at", null: false
  274. t.boolean "disabled", default: false, null: false
  275. t.string "uri"
  276. t.string "image_remote_url"
  277. t.boolean "visible_in_picker", default: true, null: false
  278. t.bigint "category_id"
  279. t.integer "image_storage_schema_version"
  280. t.index ["shortcode", "domain"], name: "index_custom_emojis_on_shortcode_and_domain", unique: true
  281. end
  282. create_table "custom_filters", force: :cascade do |t|
  283. t.bigint "account_id"
  284. t.datetime "expires_at"
  285. t.text "phrase", default: "", null: false
  286. t.string "context", default: [], null: false, array: true
  287. t.boolean "irreversible", default: false, null: false
  288. t.datetime "created_at", null: false
  289. t.datetime "updated_at", null: false
  290. t.boolean "whole_word", default: true, null: false
  291. t.index ["account_id"], name: "index_custom_filters_on_account_id"
  292. end
  293. create_table "devices", force: :cascade do |t|
  294. t.bigint "access_token_id"
  295. t.bigint "account_id"
  296. t.string "device_id", default: "", null: false
  297. t.string "name", default: "", null: false
  298. t.text "fingerprint_key", default: "", null: false
  299. t.text "identity_key", default: "", null: false
  300. t.datetime "created_at", null: false
  301. t.datetime "updated_at", null: false
  302. t.index ["access_token_id"], name: "index_devices_on_access_token_id"
  303. t.index ["account_id"], name: "index_devices_on_account_id"
  304. end
  305. create_table "domain_allows", force: :cascade do |t|
  306. t.string "domain", default: "", null: false
  307. t.datetime "created_at", null: false
  308. t.datetime "updated_at", null: false
  309. t.index ["domain"], name: "index_domain_allows_on_domain", unique: true
  310. end
  311. create_table "domain_blocks", force: :cascade do |t|
  312. t.string "domain", default: "", null: false
  313. t.datetime "created_at", null: false
  314. t.datetime "updated_at", null: false
  315. t.integer "severity", default: 0
  316. t.boolean "reject_media", default: false, null: false
  317. t.boolean "reject_reports", default: false, null: false
  318. t.text "private_comment"
  319. t.text "public_comment"
  320. t.index ["domain"], name: "index_domain_blocks_on_domain", unique: true
  321. end
  322. create_table "email_domain_blocks", force: :cascade do |t|
  323. t.string "domain", default: "", null: false
  324. t.datetime "created_at", null: false
  325. t.datetime "updated_at", null: false
  326. t.bigint "parent_id"
  327. t.index ["domain"], name: "index_email_domain_blocks_on_domain", unique: true
  328. end
  329. create_table "encrypted_messages", id: :bigint, default: -> { "timestamp_id('encrypted_messages'::text)" }, force: :cascade do |t|
  330. t.bigint "device_id"
  331. t.bigint "from_account_id"
  332. t.string "from_device_id", default: "", null: false
  333. t.integer "type", default: 0, null: false
  334. t.text "body", default: "", null: false
  335. t.text "digest", default: "", null: false
  336. t.text "message_franking", default: "", null: false
  337. t.datetime "created_at", null: false
  338. t.datetime "updated_at", null: false
  339. t.index ["device_id"], name: "index_encrypted_messages_on_device_id"
  340. t.index ["from_account_id"], name: "index_encrypted_messages_on_from_account_id"
  341. end
  342. create_table "favourites", force: :cascade do |t|
  343. t.datetime "created_at", null: false
  344. t.datetime "updated_at", null: false
  345. t.bigint "account_id", null: false
  346. t.bigint "status_id", null: false
  347. t.index ["account_id", "id"], name: "index_favourites_on_account_id_and_id"
  348. t.index ["account_id", "status_id"], name: "index_favourites_on_account_id_and_status_id", unique: true
  349. t.index ["status_id"], name: "index_favourites_on_status_id"
  350. end
  351. create_table "featured_tags", force: :cascade do |t|
  352. t.bigint "account_id"
  353. t.bigint "tag_id"
  354. t.bigint "statuses_count", default: 0, null: false
  355. t.datetime "last_status_at"
  356. t.datetime "created_at", null: false
  357. t.datetime "updated_at", null: false
  358. t.index ["account_id"], name: "index_featured_tags_on_account_id"
  359. t.index ["tag_id"], name: "index_featured_tags_on_tag_id"
  360. end
  361. create_table "follow_requests", force: :cascade do |t|
  362. t.datetime "created_at", null: false
  363. t.datetime "updated_at", null: false
  364. t.bigint "account_id", null: false
  365. t.bigint "target_account_id", null: false
  366. t.boolean "show_reblogs", default: true, null: false
  367. t.string "uri"
  368. t.index ["account_id", "target_account_id"], name: "index_follow_requests_on_account_id_and_target_account_id", unique: true
  369. end
  370. create_table "follows", force: :cascade do |t|
  371. t.datetime "created_at", null: false
  372. t.datetime "updated_at", null: false
  373. t.bigint "account_id", null: false
  374. t.bigint "target_account_id", null: false
  375. t.boolean "show_reblogs", default: true, null: false
  376. t.string "uri"
  377. t.index ["account_id", "target_account_id"], name: "index_follows_on_account_id_and_target_account_id", unique: true
  378. t.index ["target_account_id"], name: "index_follows_on_target_account_id"
  379. end
  380. create_table "identities", force: :cascade do |t|
  381. t.string "provider", default: "", null: false
  382. t.string "uid", default: "", null: false
  383. t.datetime "created_at", null: false
  384. t.datetime "updated_at", null: false
  385. t.bigint "user_id"
  386. t.index ["user_id"], name: "index_identities_on_user_id"
  387. end
  388. create_table "imports", force: :cascade do |t|
  389. t.integer "type", null: false
  390. t.boolean "approved", default: false, null: false
  391. t.datetime "created_at", null: false
  392. t.datetime "updated_at", null: false
  393. t.string "data_file_name"
  394. t.string "data_content_type"
  395. t.integer "data_file_size"
  396. t.datetime "data_updated_at"
  397. t.bigint "account_id", null: false
  398. t.boolean "overwrite", default: false, null: false
  399. end
  400. create_table "invites", force: :cascade do |t|
  401. t.bigint "user_id", null: false
  402. t.string "code", default: "", null: false
  403. t.datetime "expires_at"
  404. t.integer "max_uses"
  405. t.integer "uses", default: 0, null: false
  406. t.datetime "created_at", null: false
  407. t.datetime "updated_at", null: false
  408. t.boolean "autofollow", default: false, null: false
  409. t.text "comment"
  410. t.index ["code"], name: "index_invites_on_code", unique: true
  411. t.index ["user_id"], name: "index_invites_on_user_id"
  412. end
  413. create_table "list_accounts", force: :cascade do |t|
  414. t.bigint "list_id", null: false
  415. t.bigint "account_id", null: false
  416. t.bigint "follow_id"
  417. t.index ["account_id", "list_id"], name: "index_list_accounts_on_account_id_and_list_id", unique: true
  418. t.index ["follow_id"], name: "index_list_accounts_on_follow_id"
  419. t.index ["list_id", "account_id"], name: "index_list_accounts_on_list_id_and_account_id"
  420. end
  421. create_table "lists", force: :cascade do |t|
  422. t.bigint "account_id", null: false
  423. t.string "title", default: "", null: false
  424. t.datetime "created_at", null: false
  425. t.datetime "updated_at", null: false
  426. t.index ["account_id"], name: "index_lists_on_account_id"
  427. end
  428. create_table "markers", force: :cascade do |t|
  429. t.bigint "user_id"
  430. t.string "timeline", default: "", null: false
  431. t.bigint "last_read_id", default: 0, null: false
  432. t.integer "lock_version", default: 0, null: false
  433. t.datetime "created_at", null: false
  434. t.datetime "updated_at", null: false
  435. t.index ["user_id", "timeline"], name: "index_markers_on_user_id_and_timeline", unique: true
  436. t.index ["user_id"], name: "index_markers_on_user_id"
  437. end
  438. create_table "media_attachments", force: :cascade do |t|
  439. t.bigint "status_id"
  440. t.string "file_file_name"
  441. t.string "file_content_type"
  442. t.integer "file_file_size"
  443. t.datetime "file_updated_at"
  444. t.string "remote_url", default: "", null: false
  445. t.datetime "created_at", null: false
  446. t.datetime "updated_at", null: false
  447. t.string "shortcode"
  448. t.integer "type", default: 0, null: false
  449. t.json "file_meta"
  450. t.bigint "account_id"
  451. t.text "description"
  452. t.bigint "scheduled_status_id"
  453. t.string "blurhash"
  454. t.integer "processing"
  455. t.integer "file_storage_schema_version"
  456. t.index ["account_id"], name: "index_media_attachments_on_account_id"
  457. t.index ["scheduled_status_id"], name: "index_media_attachments_on_scheduled_status_id"
  458. t.index ["shortcode"], name: "index_media_attachments_on_shortcode", unique: true
  459. t.index ["status_id"], name: "index_media_attachments_on_status_id"
  460. end
  461. create_table "mentions", force: :cascade do |t|
  462. t.bigint "status_id"
  463. t.datetime "created_at", null: false
  464. t.datetime "updated_at", null: false
  465. t.bigint "account_id"
  466. t.boolean "silent", default: false, null: false
  467. t.index ["account_id", "status_id"], name: "index_mentions_on_account_id_and_status_id", unique: true
  468. t.index ["status_id"], name: "index_mentions_on_status_id"
  469. end
  470. create_table "mutes", force: :cascade do |t|
  471. t.datetime "created_at", null: false
  472. t.datetime "updated_at", null: false
  473. t.boolean "hide_notifications", default: true, null: false
  474. t.bigint "account_id", null: false
  475. t.bigint "target_account_id", null: false
  476. t.index ["account_id", "target_account_id"], name: "index_mutes_on_account_id_and_target_account_id", unique: true
  477. t.index ["target_account_id"], name: "index_mutes_on_target_account_id"
  478. end
  479. create_table "notifications", force: :cascade do |t|
  480. t.bigint "activity_id", null: false
  481. t.string "activity_type", null: false
  482. t.datetime "created_at", null: false
  483. t.datetime "updated_at", null: false
  484. t.bigint "account_id", null: false
  485. t.bigint "from_account_id", null: false
  486. t.index ["account_id", "activity_id", "activity_type"], name: "account_activity", unique: true
  487. t.index ["account_id", "id"], name: "index_notifications_on_account_id_and_id", order: { id: :desc }
  488. t.index ["activity_id", "activity_type"], name: "index_notifications_on_activity_id_and_activity_type"
  489. t.index ["from_account_id"], name: "index_notifications_on_from_account_id"
  490. end
  491. create_table "oauth_access_grants", force: :cascade do |t|
  492. t.string "token", null: false
  493. t.integer "expires_in", null: false
  494. t.text "redirect_uri", null: false
  495. t.datetime "created_at", null: false
  496. t.datetime "revoked_at"
  497. t.string "scopes"
  498. t.bigint "application_id", null: false
  499. t.bigint "resource_owner_id", null: false
  500. t.index ["resource_owner_id"], name: "index_oauth_access_grants_on_resource_owner_id"
  501. t.index ["token"], name: "index_oauth_access_grants_on_token", unique: true
  502. end
  503. create_table "oauth_access_tokens", force: :cascade do |t|
  504. t.string "token", null: false
  505. t.string "refresh_token"
  506. t.integer "expires_in"
  507. t.datetime "revoked_at"
  508. t.datetime "created_at", null: false
  509. t.string "scopes"
  510. t.bigint "application_id"
  511. t.bigint "resource_owner_id"
  512. t.index ["refresh_token"], name: "index_oauth_access_tokens_on_refresh_token", unique: true
  513. t.index ["resource_owner_id"], name: "index_oauth_access_tokens_on_resource_owner_id"
  514. t.index ["token"], name: "index_oauth_access_tokens_on_token", unique: true
  515. end
  516. create_table "oauth_applications", force: :cascade do |t|
  517. t.string "name", null: false
  518. t.string "uid", null: false
  519. t.string "secret", null: false
  520. t.text "redirect_uri", null: false
  521. t.string "scopes", default: "", null: false
  522. t.datetime "created_at"
  523. t.datetime "updated_at"
  524. t.boolean "superapp", default: false, null: false
  525. t.string "website"
  526. t.string "owner_type"
  527. t.bigint "owner_id"
  528. t.boolean "confidential", default: true, null: false
  529. t.index ["owner_id", "owner_type"], name: "index_oauth_applications_on_owner_id_and_owner_type"
  530. t.index ["uid"], name: "index_oauth_applications_on_uid", unique: true
  531. end
  532. create_table "one_time_keys", force: :cascade do |t|
  533. t.bigint "device_id"
  534. t.string "key_id", default: "", null: false
  535. t.text "key", default: "", null: false
  536. t.text "signature", default: "", null: false
  537. t.datetime "created_at", null: false
  538. t.datetime "updated_at", null: false
  539. t.index ["device_id"], name: "index_one_time_keys_on_device_id"
  540. t.index ["key_id"], name: "index_one_time_keys_on_key_id"
  541. end
  542. create_table "pghero_space_stats", force: :cascade do |t|
  543. t.text "database"
  544. t.text "schema"
  545. t.text "relation"
  546. t.bigint "size"
  547. t.datetime "captured_at"
  548. t.index ["database", "captured_at"], name: "index_pghero_space_stats_on_database_and_captured_at"
  549. end
  550. create_table "poll_votes", force: :cascade do |t|
  551. t.bigint "account_id"
  552. t.bigint "poll_id"
  553. t.integer "choice", default: 0, null: false
  554. t.datetime "created_at", null: false
  555. t.datetime "updated_at", null: false
  556. t.string "uri"
  557. t.index ["account_id"], name: "index_poll_votes_on_account_id"
  558. t.index ["poll_id"], name: "index_poll_votes_on_poll_id"
  559. end
  560. create_table "polls", force: :cascade do |t|
  561. t.bigint "account_id"
  562. t.bigint "status_id"
  563. t.datetime "expires_at"
  564. t.string "options", default: [], null: false, array: true
  565. t.bigint "cached_tallies", default: [], null: false, array: true
  566. t.boolean "multiple", default: false, null: false
  567. t.boolean "hide_totals", default: false, null: false
  568. t.bigint "votes_count", default: 0, null: false
  569. t.datetime "last_fetched_at"
  570. t.datetime "created_at", null: false
  571. t.datetime "updated_at", null: false
  572. t.integer "lock_version", default: 0, null: false
  573. t.bigint "voters_count"
  574. t.index ["account_id"], name: "index_polls_on_account_id"
  575. t.index ["status_id"], name: "index_polls_on_status_id"
  576. end
  577. create_table "preview_cards", force: :cascade do |t|
  578. t.string "url", default: "", null: false
  579. t.string "title", default: "", null: false
  580. t.string "description", default: "", null: false
  581. t.string "image_file_name"
  582. t.string "image_content_type"
  583. t.integer "image_file_size"
  584. t.datetime "image_updated_at"
  585. t.integer "type", default: 0, null: false
  586. t.text "html", default: "", null: false
  587. t.string "author_name", default: "", null: false
  588. t.string "author_url", default: "", null: false
  589. t.string "provider_name", default: "", null: false
  590. t.string "provider_url", default: "", null: false
  591. t.integer "width", default: 0, null: false
  592. t.integer "height", default: 0, null: false
  593. t.datetime "created_at", null: false
  594. t.datetime "updated_at", null: false
  595. t.string "embed_url", default: "", null: false
  596. t.integer "image_storage_schema_version"
  597. t.string "blurhash"
  598. t.index ["url"], name: "index_preview_cards_on_url", unique: true
  599. end
  600. create_table "preview_cards_statuses", id: false, force: :cascade do |t|
  601. t.bigint "preview_card_id", null: false
  602. t.bigint "status_id", null: false
  603. t.index ["status_id", "preview_card_id"], name: "index_preview_cards_statuses_on_status_id_and_preview_card_id"
  604. end
  605. create_table "relays", force: :cascade do |t|
  606. t.string "inbox_url", default: "", null: false
  607. t.string "follow_activity_id"
  608. t.datetime "created_at", null: false
  609. t.datetime "updated_at", null: false
  610. t.integer "state", default: 0, null: false
  611. end
  612. create_table "report_notes", force: :cascade do |t|
  613. t.text "content", null: false
  614. t.bigint "report_id", null: false
  615. t.bigint "account_id", null: false
  616. t.datetime "created_at", null: false
  617. t.datetime "updated_at", null: false
  618. t.index ["account_id"], name: "index_report_notes_on_account_id"
  619. t.index ["report_id"], name: "index_report_notes_on_report_id"
  620. end
  621. create_table "reports", force: :cascade do |t|
  622. t.bigint "status_ids", default: [], null: false, array: true
  623. t.text "comment", default: "", null: false
  624. t.boolean "action_taken", default: false, null: false
  625. t.datetime "created_at", null: false
  626. t.datetime "updated_at", null: false
  627. t.bigint "account_id", null: false
  628. t.bigint "action_taken_by_account_id"
  629. t.bigint "target_account_id", null: false
  630. t.bigint "assigned_account_id"
  631. t.string "uri"
  632. t.index ["account_id"], name: "index_reports_on_account_id"
  633. t.index ["target_account_id"], name: "index_reports_on_target_account_id"
  634. end
  635. create_table "scheduled_statuses", force: :cascade do |t|
  636. t.bigint "account_id"
  637. t.datetime "scheduled_at"
  638. t.jsonb "params"
  639. t.index ["account_id"], name: "index_scheduled_statuses_on_account_id"
  640. t.index ["scheduled_at"], name: "index_scheduled_statuses_on_scheduled_at"
  641. end
  642. create_table "session_activations", force: :cascade do |t|
  643. t.string "session_id", null: false
  644. t.datetime "created_at", null: false
  645. t.datetime "updated_at", null: false
  646. t.string "user_agent", default: "", null: false
  647. t.inet "ip"
  648. t.bigint "access_token_id"
  649. t.bigint "user_id", null: false
  650. t.bigint "web_push_subscription_id"
  651. t.index ["access_token_id"], name: "index_session_activations_on_access_token_id"
  652. t.index ["session_id"], name: "index_session_activations_on_session_id", unique: true
  653. t.index ["user_id"], name: "index_session_activations_on_user_id"
  654. end
  655. create_table "settings", force: :cascade do |t|
  656. t.string "var", null: false
  657. t.text "value"
  658. t.string "thing_type"
  659. t.datetime "created_at"
  660. t.datetime "updated_at"
  661. t.bigint "thing_id"
  662. t.index ["thing_type", "thing_id", "var"], name: "index_settings_on_thing_type_and_thing_id_and_var", unique: true
  663. end
  664. create_table "site_uploads", force: :cascade do |t|
  665. t.string "var", default: "", null: false
  666. t.string "file_file_name"
  667. t.string "file_content_type"
  668. t.integer "file_file_size"
  669. t.datetime "file_updated_at"
  670. t.json "meta"
  671. t.datetime "created_at", null: false
  672. t.datetime "updated_at", null: false
  673. t.index ["var"], name: "index_site_uploads_on_var", unique: true
  674. end
  675. create_table "status_pins", force: :cascade do |t|
  676. t.bigint "account_id", null: false
  677. t.bigint "status_id", null: false
  678. t.datetime "created_at", default: -> { "now()" }, null: false
  679. t.datetime "updated_at", default: -> { "now()" }, null: false
  680. t.index ["account_id", "status_id"], name: "index_status_pins_on_account_id_and_status_id", unique: true
  681. end
  682. create_table "status_stats", force: :cascade do |t|
  683. t.bigint "status_id", null: false
  684. t.bigint "replies_count", default: 0, null: false
  685. t.bigint "reblogs_count", default: 0, null: false
  686. t.bigint "favourites_count", default: 0, null: false
  687. t.datetime "created_at", null: false
  688. t.datetime "updated_at", null: false
  689. t.index ["status_id"], name: "index_status_stats_on_status_id", unique: true
  690. end
  691. create_table "statuses", id: :bigint, default: -> { "timestamp_id('statuses'::text)" }, force: :cascade do |t|
  692. t.string "uri"
  693. t.text "text", default: "", null: false
  694. t.datetime "created_at", null: false
  695. t.datetime "updated_at", null: false
  696. t.bigint "in_reply_to_id"
  697. t.bigint "reblog_of_id"
  698. t.string "url"
  699. t.boolean "sensitive", default: false, null: false
  700. t.integer "visibility", default: 0, null: false
  701. t.text "spoiler_text", default: "", null: false
  702. t.boolean "reply", default: false, null: false
  703. t.string "language"
  704. t.bigint "conversation_id"
  705. t.boolean "local"
  706. t.bigint "account_id", null: false
  707. t.bigint "application_id"
  708. t.bigint "in_reply_to_account_id"
  709. t.bigint "poll_id"
  710. t.datetime "deleted_at"
  711. t.index ["account_id", "id", "visibility", "updated_at"], name: "index_statuses_20190820", order: { id: :desc }, where: "(deleted_at IS NULL)"
  712. t.index ["id", "account_id"], name: "index_statuses_local_20190824", order: { id: :desc }, where: "((local OR (uri IS NULL)) AND (deleted_at IS NULL) AND (visibility = 0) AND (reblog_of_id IS NULL) AND ((NOT reply) OR (in_reply_to_account_id = account_id)))"
  713. t.index ["id", "account_id"], name: "index_statuses_public_20200119", order: { id: :desc }, where: "((deleted_at IS NULL) AND (visibility = 0) AND (reblog_of_id IS NULL) AND ((NOT reply) OR (in_reply_to_account_id = account_id)))"
  714. t.index ["in_reply_to_account_id"], name: "index_statuses_on_in_reply_to_account_id"
  715. t.index ["in_reply_to_id"], name: "index_statuses_on_in_reply_to_id"
  716. t.index ["reblog_of_id", "account_id"], name: "index_statuses_on_reblog_of_id_and_account_id"
  717. t.index ["uri"], name: "index_statuses_on_uri", unique: true
  718. end
  719. create_table "statuses_tags", id: false, force: :cascade do |t|
  720. t.bigint "status_id", null: false
  721. t.bigint "tag_id", null: false
  722. t.index ["status_id"], name: "index_statuses_tags_on_status_id"
  723. t.index ["tag_id", "status_id"], name: "index_statuses_tags_on_tag_id_and_status_id", unique: true
  724. end
  725. create_table "system_keys", force: :cascade do |t|
  726. t.binary "key"
  727. t.datetime "created_at", null: false
  728. t.datetime "updated_at", null: false
  729. end
  730. create_table "tags", force: :cascade do |t|
  731. t.string "name", default: "", null: false
  732. t.datetime "created_at", null: false
  733. t.datetime "updated_at", null: false
  734. t.boolean "usable"
  735. t.boolean "trendable"
  736. t.boolean "listable"
  737. t.datetime "reviewed_at"
  738. t.datetime "requested_review_at"
  739. t.datetime "last_status_at"
  740. t.float "max_score"
  741. t.datetime "max_score_at"
  742. t.index "lower((name)::text)", name: "index_tags_on_name_lower", unique: true
  743. end
  744. create_table "tombstones", force: :cascade do |t|
  745. t.bigint "account_id"
  746. t.string "uri", null: false
  747. t.datetime "created_at", null: false
  748. t.datetime "updated_at", null: false
  749. t.boolean "by_moderator"
  750. t.index ["account_id"], name: "index_tombstones_on_account_id"
  751. t.index ["uri"], name: "index_tombstones_on_uri"
  752. end
  753. create_table "unavailable_domains", force: :cascade do |t|
  754. t.string "domain", default: "", null: false
  755. t.datetime "created_at", null: false
  756. t.datetime "updated_at", null: false
  757. t.index ["domain"], name: "index_unavailable_domains_on_domain", unique: true
  758. end
  759. create_table "user_invite_requests", force: :cascade do |t|
  760. t.bigint "user_id"
  761. t.text "text"
  762. t.datetime "created_at", null: false
  763. t.datetime "updated_at", null: false
  764. t.index ["user_id"], name: "index_user_invite_requests_on_user_id"
  765. end
  766. create_table "users", force: :cascade do |t|
  767. t.string "email", default: "", null: false
  768. t.datetime "created_at", null: false
  769. t.datetime "updated_at", null: false
  770. t.string "encrypted_password", default: "", null: false
  771. t.string "reset_password_token"
  772. t.datetime "reset_password_sent_at"
  773. t.datetime "remember_created_at"
  774. t.integer "sign_in_count", default: 0, null: false
  775. t.datetime "current_sign_in_at"
  776. t.datetime "last_sign_in_at"
  777. t.inet "current_sign_in_ip"
  778. t.inet "last_sign_in_ip"
  779. t.boolean "admin", default: false, null: false
  780. t.string "confirmation_token"
  781. t.datetime "confirmed_at"
  782. t.datetime "confirmation_sent_at"
  783. t.string "unconfirmed_email"
  784. t.string "locale"
  785. t.string "encrypted_otp_secret"
  786. t.string "encrypted_otp_secret_iv"
  787. t.string "encrypted_otp_secret_salt"
  788. t.integer "consumed_timestep"
  789. t.boolean "otp_required_for_login", default: false, null: false
  790. t.datetime "last_emailed_at"
  791. t.string "otp_backup_codes", array: true
  792. t.string "filtered_languages", default: [], null: false, array: true
  793. t.bigint "account_id", null: false
  794. t.boolean "disabled", default: false, null: false
  795. t.boolean "moderator", default: false, null: false
  796. t.bigint "invite_id"
  797. t.string "remember_token"
  798. t.string "chosen_languages", array: true
  799. t.bigint "created_by_application_id"
  800. t.boolean "approved", default: true, null: false
  801. t.index ["account_id"], name: "index_users_on_account_id"
  802. t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
  803. t.index ["created_by_application_id"], name: "index_users_on_created_by_application_id"
  804. t.index ["email"], name: "index_users_on_email", unique: true
  805. t.index ["remember_token"], name: "index_users_on_remember_token", unique: true
  806. t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
  807. end
  808. create_table "web_push_subscriptions", force: :cascade do |t|
  809. t.string "endpoint", null: false
  810. t.string "key_p256dh", null: false
  811. t.string "key_auth", null: false
  812. t.json "data"
  813. t.datetime "created_at", null: false
  814. t.datetime "updated_at", null: false
  815. t.bigint "access_token_id"
  816. t.bigint "user_id"
  817. t.index ["access_token_id"], name: "index_web_push_subscriptions_on_access_token_id"
  818. t.index ["user_id"], name: "index_web_push_subscriptions_on_user_id"
  819. end
  820. create_table "web_settings", force: :cascade do |t|
  821. t.json "data"
  822. t.datetime "created_at", null: false
  823. t.datetime "updated_at", null: false
  824. t.bigint "user_id", null: false
  825. t.index ["user_id"], name: "index_web_settings_on_user_id", unique: true
  826. end
  827. add_foreign_key "account_aliases", "accounts", on_delete: :cascade
  828. add_foreign_key "account_conversations", "accounts", on_delete: :cascade
  829. add_foreign_key "account_conversations", "conversations", on_delete: :cascade
  830. add_foreign_key "account_domain_blocks", "accounts", name: "fk_206c6029bd", on_delete: :cascade
  831. add_foreign_key "account_identity_proofs", "accounts", on_delete: :cascade
  832. add_foreign_key "account_migrations", "accounts", column: "target_account_id", on_delete: :nullify
  833. add_foreign_key "account_migrations", "accounts", on_delete: :cascade
  834. add_foreign_key "account_moderation_notes", "accounts"
  835. add_foreign_key "account_moderation_notes", "accounts", column: "target_account_id"
  836. add_foreign_key "account_pins", "accounts", column: "target_account_id", on_delete: :cascade
  837. add_foreign_key "account_pins", "accounts", on_delete: :cascade
  838. add_foreign_key "account_stats", "accounts", on_delete: :cascade
  839. add_foreign_key "account_tag_stats", "tags", on_delete: :cascade
  840. add_foreign_key "account_warnings", "accounts", column: "target_account_id", on_delete: :cascade
  841. add_foreign_key "account_warnings", "accounts", on_delete: :nullify
  842. add_foreign_key "accounts", "accounts", column: "moved_to_account_id", on_delete: :nullify
  843. add_foreign_key "admin_action_logs", "accounts", on_delete: :cascade
  844. add_foreign_key "announcement_mutes", "accounts", on_delete: :cascade
  845. add_foreign_key "announcement_mutes", "announcements", on_delete: :cascade
  846. add_foreign_key "announcement_reactions", "accounts", on_delete: :cascade
  847. add_foreign_key "announcement_reactions", "announcements", on_delete: :cascade
  848. add_foreign_key "announcement_reactions", "custom_emojis", on_delete: :cascade
  849. add_foreign_key "backups", "users", on_delete: :nullify
  850. add_foreign_key "blocks", "accounts", column: "target_account_id", name: "fk_9571bfabc1", on_delete: :cascade
  851. add_foreign_key "blocks", "accounts", name: "fk_4269e03e65", on_delete: :cascade
  852. add_foreign_key "bookmarks", "accounts", on_delete: :cascade
  853. add_foreign_key "bookmarks", "statuses", on_delete: :cascade
  854. add_foreign_key "conversation_mutes", "accounts", name: "fk_225b4212bb", on_delete: :cascade
  855. add_foreign_key "conversation_mutes", "conversations", on_delete: :cascade
  856. add_foreign_key "custom_filters", "accounts", on_delete: :cascade
  857. add_foreign_key "devices", "accounts", on_delete: :cascade
  858. add_foreign_key "devices", "oauth_access_tokens", column: "access_token_id", on_delete: :cascade
  859. add_foreign_key "email_domain_blocks", "email_domain_blocks", column: "parent_id", on_delete: :cascade
  860. add_foreign_key "encrypted_messages", "accounts", column: "from_account_id", on_delete: :cascade
  861. add_foreign_key "encrypted_messages", "devices", on_delete: :cascade
  862. add_foreign_key "favourites", "accounts", name: "fk_5eb6c2b873", on_delete: :cascade
  863. add_foreign_key "favourites", "statuses", name: "fk_b0e856845e", on_delete: :cascade
  864. add_foreign_key "featured_tags", "accounts", on_delete: :cascade
  865. add_foreign_key "featured_tags", "tags", on_delete: :cascade
  866. add_foreign_key "follow_requests", "accounts", column: "target_account_id", name: "fk_9291ec025d", on_delete: :cascade
  867. add_foreign_key "follow_requests", "accounts", name: "fk_76d644b0e7", on_delete: :cascade
  868. add_foreign_key "follows", "accounts", column: "target_account_id", name: "fk_745ca29eac", on_delete: :cascade
  869. add_foreign_key "follows", "accounts", name: "fk_32ed1b5560", on_delete: :cascade
  870. add_foreign_key "identities", "users", name: "fk_bea040f377", on_delete: :cascade
  871. add_foreign_key "imports", "accounts", name: "fk_6db1b6e408", on_delete: :cascade
  872. add_foreign_key "invites", "users", on_delete: :cascade
  873. add_foreign_key "list_accounts", "accounts", on_delete: :cascade
  874. add_foreign_key "list_accounts", "follows", on_delete: :cascade
  875. add_foreign_key "list_accounts", "lists", on_delete: :cascade
  876. add_foreign_key "lists", "accounts", on_delete: :cascade
  877. add_foreign_key "markers", "users", on_delete: :cascade
  878. add_foreign_key "media_attachments", "accounts", name: "fk_96dd81e81b", on_delete: :nullify
  879. add_foreign_key "media_attachments", "scheduled_statuses", on_delete: :nullify
  880. add_foreign_key "media_attachments", "statuses", on_delete: :nullify
  881. add_foreign_key "mentions", "accounts", name: "fk_970d43f9d1", on_delete: :cascade
  882. add_foreign_key "mentions", "statuses", on_delete: :cascade
  883. add_foreign_key "mutes", "accounts", column: "target_account_id", name: "fk_eecff219ea", on_delete: :cascade
  884. add_foreign_key "mutes", "accounts", name: "fk_b8d8daf315", on_delete: :cascade
  885. add_foreign_key "notifications", "accounts", column: "from_account_id", name: "fk_fbd6b0bf9e", on_delete: :cascade
  886. add_foreign_key "notifications", "accounts", name: "fk_c141c8ee55", on_delete: :cascade
  887. add_foreign_key "oauth_access_grants", "oauth_applications", column: "application_id", name: "fk_34d54b0a33", on_delete: :cascade
  888. add_foreign_key "oauth_access_grants", "users", column: "resource_owner_id", name: "fk_63b044929b", on_delete: :cascade
  889. add_foreign_key "oauth_access_tokens", "oauth_applications", column: "application_id", name: "fk_f5fc4c1ee3", on_delete: :cascade
  890. add_foreign_key "oauth_access_tokens", "users", column: "resource_owner_id", name: "fk_e84df68546", on_delete: :cascade
  891. add_foreign_key "oauth_applications", "users", column: "owner_id", name: "fk_b0988c7c0a", on_delete: :cascade
  892. add_foreign_key "one_time_keys", "devices", on_delete: :cascade
  893. add_foreign_key "poll_votes", "accounts", on_delete: :cascade
  894. add_foreign_key "poll_votes", "polls", on_delete: :cascade
  895. add_foreign_key "polls", "accounts", on_delete: :cascade
  896. add_foreign_key "polls", "statuses", on_delete: :cascade
  897. add_foreign_key "report_notes", "accounts", on_delete: :cascade
  898. add_foreign_key "report_notes", "reports", on_delete: :cascade
  899. add_foreign_key "reports", "accounts", column: "action_taken_by_account_id", name: "fk_bca45b75fd", on_delete: :nullify
  900. add_foreign_key "reports", "accounts", column: "assigned_account_id", on_delete: :nullify
  901. add_foreign_key "reports", "accounts", column: "target_account_id", name: "fk_eb37af34f0", on_delete: :cascade
  902. add_foreign_key "reports", "accounts", name: "fk_4b81f7522c", on_delete: :cascade
  903. add_foreign_key "scheduled_statuses", "accounts", on_delete: :cascade
  904. add_foreign_key "session_activations", "oauth_access_tokens", column: "access_token_id", name: "fk_957e5bda89", on_delete: :cascade
  905. add_foreign_key "session_activations", "users", name: "fk_e5fda67334", on_delete: :cascade
  906. add_foreign_key "status_pins", "accounts", name: "fk_d4cb435b62", on_delete: :cascade
  907. add_foreign_key "status_pins", "statuses", on_delete: :cascade
  908. add_foreign_key "status_stats", "statuses", on_delete: :cascade
  909. add_foreign_key "statuses", "accounts", column: "in_reply_to_account_id", name: "fk_c7fa917661", on_delete: :nullify
  910. add_foreign_key "statuses", "accounts", name: "fk_9bda1543f7", on_delete: :cascade
  911. add_foreign_key "statuses", "statuses", column: "in_reply_to_id", on_delete: :nullify
  912. add_foreign_key "statuses", "statuses", column: "reblog_of_id", on_delete: :cascade
  913. add_foreign_key "statuses_tags", "statuses", on_delete: :cascade
  914. add_foreign_key "statuses_tags", "tags", name: "fk_3081861e21", on_delete: :cascade
  915. add_foreign_key "tombstones", "accounts", on_delete: :cascade
  916. add_foreign_key "user_invite_requests", "users", on_delete: :cascade
  917. add_foreign_key "users", "accounts", name: "fk_50500f500d", on_delete: :cascade
  918. add_foreign_key "users", "invites", on_delete: :nullify
  919. add_foreign_key "users", "oauth_applications", column: "created_by_application_id", on_delete: :nullify
  920. add_foreign_key "web_push_subscriptions", "oauth_access_tokens", column: "access_token_id", on_delete: :cascade
  921. add_foreign_key "web_push_subscriptions", "users", on_delete: :cascade
  922. add_foreign_key "web_settings", "users", name: "fk_11910667b2", on_delete: :cascade
  923. end