闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

483 lines
21 KiB

8 years ago
8 years ago
Account domain blocks (#2381) * Add <ostatus:conversation /> tag to Atom input/output Only uses ref attribute (not href) because href would be the alternate link that's always included also. Creates new conversation for every non-reply status. Carries over conversation for every reply. Keeps remote URIs verbatim, generates local URIs on the fly like the rest of them. * Conversation muting - prevents notifications that reference a conversation (including replies, favourites, reblogs) from being created. API endpoints /api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute Currently no way to tell when a status/conversation is muted, so the web UI only has a "disable notifications" button, doesn't work as a toggle * Display "Dismiss notifications" on all statuses in notifications column, not just own * Add "muted" as a boolean attribute on statuses JSON For now always false on contained reblogs, since it's only relevant for statuses returned from the notifications endpoint, which are not nested Remove "Disable notifications" from detailed status view, since it's only relevant in the notifications column * Up max class length * Remove pending test for conversation mute * Add tests, clean up * Rename to "mute conversation" and "unmute conversation" * Raise validation error when trying to mute/unmute status without conversation * Adding account domain blocks that filter notifications and public timelines * Add tests for domain blocks in notifications, public timelines Filter reblogs of blocked domains from home * Add API for listing and creating account domain blocks * API for creating/deleting domain blocks, tests for Status#ancestors and Status#descendants, filter domain blocks from them * Filter domains in streaming API * Update account_domain_block_spec.rb
7 years ago
Account domain blocks (#2381) * Add <ostatus:conversation /> tag to Atom input/output Only uses ref attribute (not href) because href would be the alternate link that's always included also. Creates new conversation for every non-reply status. Carries over conversation for every reply. Keeps remote URIs verbatim, generates local URIs on the fly like the rest of them. * Conversation muting - prevents notifications that reference a conversation (including replies, favourites, reblogs) from being created. API endpoints /api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute Currently no way to tell when a status/conversation is muted, so the web UI only has a "disable notifications" button, doesn't work as a toggle * Display "Dismiss notifications" on all statuses in notifications column, not just own * Add "muted" as a boolean attribute on statuses JSON For now always false on contained reblogs, since it's only relevant for statuses returned from the notifications endpoint, which are not nested Remove "Disable notifications" from detailed status view, since it's only relevant in the notifications column * Up max class length * Remove pending test for conversation mute * Add tests, clean up * Rename to "mute conversation" and "unmute conversation" * Raise validation error when trying to mute/unmute status without conversation * Adding account domain blocks that filter notifications and public timelines * Add tests for domain blocks in notifications, public timelines Filter reblogs of blocked domains from home * Add API for listing and creating account domain blocks * API for creating/deleting domain blocks, tests for Status#ancestors and Status#descendants, filter domain blocks from them * Filter domains in streaming API * Update account_domain_block_spec.rb
7 years ago
8 years ago
8 years ago
8 years ago
Web Push Notifications (#3243) * feat: Register push subscription * feat: Notify when mentioned * feat: Boost, favourite, reply, follow, follow request * feat: Notification interaction * feat: Handle change of public key * feat: Unsubscribe if things go wrong * feat: Do not send normal notifications if push is enabled * feat: Focus client if open * refactor: Move push logic to WebPushSubscription * feat: Better title and body * feat: Localize messages * chore: Fix lint errors * feat: Settings * refactor: Lazy load * fix: Check if push settings exist * feat: Device-based preferences * refactor: Simplify logic * refactor: Pull request feedback * refactor: Pull request feedback * refactor: Create /api/web/push_subscriptions endpoint * feat: Spec PushSubscriptionController * refactor: WebPushSubscription => Web::PushSubscription * feat: Spec Web::PushSubscription * feat: Display first media attachment * feat: Support direction * fix: Stuff broken while rebasing * refactor: Integration with session activations * refactor: Cleanup * refactor: Simplify implementation * feat: Set VAPID keys via environment * chore: Comments * fix: Crash when no alerts * fix: Set VAPID keys in testing environment * fix: Follow link * feat: Notification actions * fix: Delete previous subscription * chore: Temporary logs * refactor: Move migration to a later date * fix: Fetch the correct session activation and misc bugs * refactor: Move migration to a later date * fix: Remove follow request (no notifications) * feat: Send administrator contact to push service * feat: Set time-to-live * fix: Do not show sensitive images * fix: Reducer crash in error handling * feat: Add badge * chore: Fix lint error * fix: Checkbox label overlap * fix: Check for payload support * fix: Rename action "type" (crash in latest Chrome) * feat: Action to expand notification * fix: Lint errors * fix: Unescape notification body * fix: Do not allow boosting if the status is hidden * feat: Add VAPID keys to the production sample environment * fix: Strip HTML tags from status * refactor: Better error messages * refactor: Handle browser not implementing the VAPID protocol (Samsung Internet) * fix: Error when target_status is nil * fix: Handle lack of image * fix: Delete reference to invalid subscriptions * feat: Better error handling * fix: Unescape HTML characters after tags are striped * refactor: Simpify code * fix: Modify to work with #4091 * Sort strings alphabetically * i18n: Updated Polish translation it annoys me that it's not fully localized :P * refactor: Use current_session in PushSubscriptionController * fix: Rebase mistake * fix: Set cacheName to mastodon * refactor: Pull request feedback * refactor: Remove logging statements * chore(yarn): Fix conflicts with master * chore(yarn): Copy latest from master * chore(yarn): Readd offline-plugin * refactor: Use save! and update! * refactor: Send notifications async * fix: Allow retry when push fails * fix: Save track for failed pushes * fix: Minify sw.js * fix: Remove account_id from fabricator
7 years ago
  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: 20170924022025) do
  13. # These are extensions that must be enabled in order to support this database
  14. enable_extension "plpgsql"
  15. create_table "account_domain_blocks", force: :cascade do |t|
  16. t.bigint "account_id"
  17. t.string "domain"
  18. t.datetime "created_at", null: false
  19. t.datetime "updated_at", null: false
  20. t.index ["account_id", "domain"], name: "index_account_domain_blocks_on_account_id_and_domain", unique: true
  21. end
  22. create_table "accounts", force: :cascade do |t|
  23. t.string "username", default: "", null: false
  24. t.string "domain"
  25. t.string "secret", default: "", null: false
  26. t.text "private_key"
  27. t.text "public_key", default: "", null: false
  28. t.string "remote_url", default: "", null: false
  29. t.string "salmon_url", default: "", null: false
  30. t.string "hub_url", default: "", null: false
  31. t.datetime "created_at", null: false
  32. t.datetime "updated_at", null: false
  33. t.text "note", default: "", null: false
  34. t.string "display_name", default: "", null: false
  35. t.string "uri", default: "", null: false
  36. t.string "url"
  37. t.string "avatar_file_name"
  38. t.string "avatar_content_type"
  39. t.integer "avatar_file_size"
  40. t.datetime "avatar_updated_at"
  41. t.string "header_file_name"
  42. t.string "header_content_type"
  43. t.integer "header_file_size"
  44. t.datetime "header_updated_at"
  45. t.string "avatar_remote_url"
  46. t.datetime "subscription_expires_at"
  47. t.boolean "silenced", default: false, null: false
  48. t.boolean "suspended", default: false, null: false
  49. t.boolean "locked", default: false, null: false
  50. t.string "header_remote_url", default: "", null: false
  51. t.integer "statuses_count", default: 0, null: false
  52. t.integer "followers_count", default: 0, null: false
  53. t.integer "following_count", default: 0, null: false
  54. t.datetime "last_webfingered_at"
  55. t.string "inbox_url", default: "", null: false
  56. t.string "outbox_url", default: "", null: false
  57. t.string "shared_inbox_url", default: "", null: false
  58. t.string "followers_url", default: "", null: false
  59. t.integer "protocol", default: 0, null: false
  60. 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
  61. t.index "lower((username)::text), lower((domain)::text)", name: "index_accounts_on_username_and_domain_lower"
  62. t.index ["uri"], name: "index_accounts_on_uri"
  63. t.index ["url"], name: "index_accounts_on_url"
  64. t.index ["username", "domain"], name: "index_accounts_on_username_and_domain", unique: true
  65. end
  66. create_table "blocks", force: :cascade do |t|
  67. t.bigint "account_id", null: false
  68. t.bigint "target_account_id", null: false
  69. t.datetime "created_at", null: false
  70. t.datetime "updated_at", null: false
  71. t.index ["account_id", "target_account_id"], name: "index_blocks_on_account_id_and_target_account_id", unique: true
  72. end
  73. create_table "conversation_mutes", force: :cascade do |t|
  74. t.bigint "account_id", null: false
  75. t.bigint "conversation_id", null: false
  76. t.index ["account_id", "conversation_id"], name: "index_conversation_mutes_on_account_id_and_conversation_id", unique: true
  77. end
  78. create_table "conversations", force: :cascade do |t|
  79. t.string "uri"
  80. t.datetime "created_at", null: false
  81. t.datetime "updated_at", null: false
  82. t.index ["uri"], name: "index_conversations_on_uri", unique: true
  83. end
  84. create_table "custom_emojis", force: :cascade do |t|
  85. t.string "shortcode", default: "", null: false
  86. t.string "domain"
  87. t.string "image_file_name"
  88. t.string "image_content_type"
  89. t.integer "image_file_size"
  90. t.datetime "image_updated_at"
  91. t.datetime "created_at", null: false
  92. t.datetime "updated_at", null: false
  93. t.index ["shortcode", "domain"], name: "index_custom_emojis_on_shortcode_and_domain", unique: true
  94. end
  95. create_table "domain_blocks", force: :cascade do |t|
  96. t.string "domain", default: "", null: false
  97. t.datetime "created_at", null: false
  98. t.datetime "updated_at", null: false
  99. t.integer "severity", default: 0
  100. t.boolean "reject_media", default: false, null: false
  101. t.index ["domain"], name: "index_domain_blocks_on_domain", unique: true
  102. end
  103. create_table "favourites", force: :cascade do |t|
  104. t.bigint "account_id", null: false
  105. t.bigint "status_id", null: false
  106. t.datetime "created_at", null: false
  107. t.datetime "updated_at", null: false
  108. t.index ["account_id", "id"], name: "index_favourites_on_account_id_and_id"
  109. t.index ["account_id", "status_id"], name: "index_favourites_on_account_id_and_status_id", unique: true
  110. t.index ["status_id"], name: "index_favourites_on_status_id"
  111. end
  112. create_table "follow_requests", force: :cascade do |t|
  113. t.bigint "account_id", null: false
  114. t.bigint "target_account_id", null: false
  115. t.datetime "created_at", null: false
  116. t.datetime "updated_at", null: false
  117. t.index ["account_id", "target_account_id"], name: "index_follow_requests_on_account_id_and_target_account_id", unique: true
  118. end
  119. create_table "follows", force: :cascade do |t|
  120. t.bigint "account_id", null: false
  121. t.bigint "target_account_id", null: false
  122. t.datetime "created_at", null: false
  123. t.datetime "updated_at", null: false
  124. t.index ["account_id", "target_account_id"], name: "index_follows_on_account_id_and_target_account_id", unique: true
  125. end
  126. create_table "imports", force: :cascade do |t|
  127. t.bigint "account_id", null: false
  128. t.integer "type", null: false
  129. t.boolean "approved", default: false, null: false
  130. t.datetime "created_at", null: false
  131. t.datetime "updated_at", null: false
  132. t.string "data_file_name"
  133. t.string "data_content_type"
  134. t.integer "data_file_size"
  135. t.datetime "data_updated_at"
  136. end
  137. create_table "media_attachments", force: :cascade do |t|
  138. t.bigint "status_id"
  139. t.string "file_file_name"
  140. t.string "file_content_type"
  141. t.integer "file_file_size"
  142. t.datetime "file_updated_at"
  143. t.string "remote_url", default: "", null: false
  144. t.bigint "account_id"
  145. t.datetime "created_at", null: false
  146. t.datetime "updated_at", null: false
  147. t.string "shortcode"
  148. t.integer "type", default: 0, null: false
  149. t.json "file_meta"
  150. t.index ["account_id"], name: "index_media_attachments_on_account_id"
  151. t.index ["shortcode"], name: "index_media_attachments_on_shortcode", unique: true
  152. t.index ["status_id"], name: "index_media_attachments_on_status_id"
  153. end
  154. create_table "mentions", force: :cascade do |t|
  155. t.bigint "account_id"
  156. t.bigint "status_id"
  157. t.datetime "created_at", null: false
  158. t.datetime "updated_at", null: false
  159. t.index ["account_id", "status_id"], name: "index_mentions_on_account_id_and_status_id", unique: true
  160. t.index ["status_id"], name: "index_mentions_on_status_id"
  161. end
  162. create_table "mutes", force: :cascade do |t|
  163. t.bigint "account_id", null: false
  164. t.bigint "target_account_id", null: false
  165. t.datetime "created_at", null: false
  166. t.datetime "updated_at", null: false
  167. t.index ["account_id", "target_account_id"], name: "index_mutes_on_account_id_and_target_account_id", unique: true
  168. end
  169. create_table "notifications", force: :cascade do |t|
  170. t.bigint "account_id"
  171. t.bigint "activity_id"
  172. t.string "activity_type"
  173. t.datetime "created_at", null: false
  174. t.datetime "updated_at", null: false
  175. t.bigint "from_account_id"
  176. t.index ["account_id", "activity_id", "activity_type"], name: "account_activity", unique: true
  177. t.index ["activity_id", "activity_type"], name: "index_notifications_on_activity_id_and_activity_type"
  178. t.index ["id", "account_id", "activity_type"], name: "index_notifications_on_id_and_account_id_and_activity_type", order: { id: :desc }
  179. end
  180. create_table "oauth_access_grants", force: :cascade do |t|
  181. t.bigint "resource_owner_id", null: false
  182. t.bigint "application_id", null: false
  183. t.string "token", null: false
  184. t.integer "expires_in", null: false
  185. t.text "redirect_uri", null: false
  186. t.datetime "created_at", null: false
  187. t.datetime "revoked_at"
  188. t.string "scopes"
  189. t.index ["token"], name: "index_oauth_access_grants_on_token", unique: true
  190. end
  191. create_table "oauth_access_tokens", force: :cascade do |t|
  192. t.bigint "resource_owner_id"
  193. t.bigint "application_id"
  194. t.string "token", null: false
  195. t.string "refresh_token"
  196. t.integer "expires_in"
  197. t.datetime "revoked_at"
  198. t.datetime "created_at", null: false
  199. t.string "scopes"
  200. t.index ["refresh_token"], name: "index_oauth_access_tokens_on_refresh_token", unique: true
  201. t.index ["resource_owner_id"], name: "index_oauth_access_tokens_on_resource_owner_id"
  202. t.index ["token"], name: "index_oauth_access_tokens_on_token", unique: true
  203. end
  204. create_table "oauth_applications", force: :cascade do |t|
  205. t.string "name", null: false
  206. t.string "uid", null: false
  207. t.string "secret", null: false
  208. t.text "redirect_uri", null: false
  209. t.string "scopes", default: "", null: false
  210. t.datetime "created_at"
  211. t.datetime "updated_at"
  212. t.boolean "superapp", default: false, null: false
  213. t.string "website"
  214. t.bigint "owner_id"
  215. t.string "owner_type"
  216. t.index ["owner_id", "owner_type"], name: "index_oauth_applications_on_owner_id_and_owner_type"
  217. t.index ["uid"], name: "index_oauth_applications_on_uid", unique: true
  218. end
  219. create_table "preview_cards", force: :cascade do |t|
  220. t.string "url", default: "", null: false
  221. t.string "title", default: "", null: false
  222. t.string "description", default: "", null: false
  223. t.string "image_file_name"
  224. t.string "image_content_type"
  225. t.integer "image_file_size"
  226. t.datetime "image_updated_at"
  227. t.integer "type", default: 0, null: false
  228. t.text "html", default: "", null: false
  229. t.string "author_name", default: "", null: false
  230. t.string "author_url", default: "", null: false
  231. t.string "provider_name", default: "", null: false
  232. t.string "provider_url", default: "", null: false
  233. t.integer "width", default: 0, null: false
  234. t.integer "height", default: 0, null: false
  235. t.datetime "created_at", null: false
  236. t.datetime "updated_at", null: false
  237. t.index ["url"], name: "index_preview_cards_on_url", unique: true
  238. end
  239. create_table "preview_cards_statuses", id: false, force: :cascade do |t|
  240. t.bigint "preview_card_id", null: false
  241. t.bigint "status_id", null: false
  242. t.index ["status_id", "preview_card_id"], name: "index_preview_cards_statuses_on_status_id_and_preview_card_id"
  243. end
  244. create_table "reports", force: :cascade do |t|
  245. t.bigint "account_id", null: false
  246. t.bigint "target_account_id", null: false
  247. t.bigint "status_ids", default: [], null: false, array: true
  248. t.text "comment", default: "", null: false
  249. t.boolean "action_taken", default: false, null: false
  250. t.datetime "created_at", null: false
  251. t.datetime "updated_at", null: false
  252. t.bigint "action_taken_by_account_id"
  253. t.index ["account_id"], name: "index_reports_on_account_id"
  254. t.index ["target_account_id"], name: "index_reports_on_target_account_id"
  255. end
  256. create_table "session_activations", force: :cascade do |t|
  257. t.bigint "user_id", null: false
  258. t.string "session_id", null: false
  259. t.datetime "created_at", null: false
  260. t.datetime "updated_at", null: false
  261. t.string "user_agent", default: "", null: false
  262. t.inet "ip"
  263. t.bigint "access_token_id"
  264. t.bigint "web_push_subscription_id"
  265. t.index ["session_id"], name: "index_session_activations_on_session_id", unique: true
  266. t.index ["user_id"], name: "index_session_activations_on_user_id"
  267. end
  268. create_table "settings", force: :cascade do |t|
  269. t.string "var", null: false
  270. t.text "value"
  271. t.string "thing_type"
  272. t.bigint "thing_id"
  273. t.datetime "created_at"
  274. t.datetime "updated_at"
  275. t.index ["thing_type", "thing_id", "var"], name: "index_settings_on_thing_type_and_thing_id_and_var", unique: true
  276. end
  277. create_table "site_uploads", force: :cascade do |t|
  278. t.string "var", default: "", null: false
  279. t.string "file_file_name"
  280. t.string "file_content_type"
  281. t.integer "file_file_size"
  282. t.datetime "file_updated_at"
  283. t.json "meta"
  284. t.datetime "created_at", null: false
  285. t.datetime "updated_at", null: false
  286. t.index ["var"], name: "index_site_uploads_on_var", unique: true
  287. end
  288. create_table "status_pins", force: :cascade do |t|
  289. t.bigint "account_id", null: false
  290. t.bigint "status_id", null: false
  291. t.datetime "created_at", default: -> { "now()" }, null: false
  292. t.datetime "updated_at", default: -> { "now()" }, null: false
  293. t.index ["account_id", "status_id"], name: "index_status_pins_on_account_id_and_status_id", unique: true
  294. end
  295. create_table "statuses", force: :cascade do |t|
  296. t.string "uri"
  297. t.bigint "account_id", null: false
  298. t.text "text", default: "", null: false
  299. t.datetime "created_at", null: false
  300. t.datetime "updated_at", null: false
  301. t.bigint "in_reply_to_id"
  302. t.bigint "reblog_of_id"
  303. t.string "url"
  304. t.boolean "sensitive", default: false, null: false
  305. t.integer "visibility", default: 0, null: false
  306. t.bigint "in_reply_to_account_id"
  307. t.bigint "application_id"
  308. t.text "spoiler_text", default: "", null: false
  309. t.boolean "reply", default: false, null: false
  310. t.integer "favourites_count", default: 0, null: false
  311. t.integer "reblogs_count", default: 0, null: false
  312. t.string "language"
  313. t.bigint "conversation_id"
  314. t.boolean "local"
  315. t.index ["account_id", "id"], name: "index_statuses_on_account_id_id"
  316. t.index ["conversation_id"], name: "index_statuses_on_conversation_id"
  317. t.index ["in_reply_to_id"], name: "index_statuses_on_in_reply_to_id"
  318. t.index ["reblog_of_id"], name: "index_statuses_on_reblog_of_id"
  319. t.index ["uri"], name: "index_statuses_on_uri", unique: true
  320. end
  321. create_table "statuses_tags", id: false, force: :cascade do |t|
  322. t.bigint "status_id", null: false
  323. t.bigint "tag_id", null: false
  324. t.index ["status_id"], name: "index_statuses_tags_on_status_id"
  325. t.index ["tag_id", "status_id"], name: "index_statuses_tags_on_tag_id_and_status_id", unique: true
  326. end
  327. create_table "stream_entries", force: :cascade do |t|
  328. t.bigint "account_id"
  329. t.bigint "activity_id"
  330. t.string "activity_type"
  331. t.datetime "created_at", null: false
  332. t.datetime "updated_at", null: false
  333. t.boolean "hidden", default: false, null: false
  334. t.index ["account_id"], name: "index_stream_entries_on_account_id"
  335. t.index ["activity_id", "activity_type"], name: "index_stream_entries_on_activity_id_and_activity_type"
  336. end
  337. create_table "subscriptions", force: :cascade do |t|
  338. t.string "callback_url", default: "", null: false
  339. t.string "secret"
  340. t.datetime "expires_at"
  341. t.boolean "confirmed", default: false, null: false
  342. t.bigint "account_id", null: false
  343. t.datetime "created_at", null: false
  344. t.datetime "updated_at", null: false
  345. t.datetime "last_successful_delivery_at"
  346. t.string "domain"
  347. t.index ["account_id", "callback_url"], name: "index_subscriptions_on_account_id_and_callback_url", unique: true
  348. end
  349. create_table "tags", force: :cascade do |t|
  350. t.string "name", default: "", null: false
  351. t.datetime "created_at", null: false
  352. t.datetime "updated_at", null: false
  353. t.index "lower((name)::text) text_pattern_ops", name: "hashtag_search_index"
  354. t.index ["name"], name: "index_tags_on_name", unique: true
  355. end
  356. create_table "users", force: :cascade do |t|
  357. t.string "email", default: "", null: false
  358. t.bigint "account_id", null: false
  359. t.datetime "created_at", null: false
  360. t.datetime "updated_at", null: false
  361. t.string "encrypted_password", default: "", null: false
  362. t.string "reset_password_token"
  363. t.datetime "reset_password_sent_at"
  364. t.datetime "remember_created_at"
  365. t.integer "sign_in_count", default: 0, null: false
  366. t.datetime "current_sign_in_at"
  367. t.datetime "last_sign_in_at"
  368. t.inet "current_sign_in_ip"
  369. t.inet "last_sign_in_ip"
  370. t.boolean "admin", default: false, null: false
  371. t.string "confirmation_token"
  372. t.datetime "confirmed_at"
  373. t.datetime "confirmation_sent_at"
  374. t.string "unconfirmed_email"
  375. t.string "locale"
  376. t.string "encrypted_otp_secret"
  377. t.string "encrypted_otp_secret_iv"
  378. t.string "encrypted_otp_secret_salt"
  379. t.integer "consumed_timestep"
  380. t.boolean "otp_required_for_login", default: false, null: false
  381. t.datetime "last_emailed_at"
  382. t.string "otp_backup_codes", array: true
  383. t.string "filtered_languages", default: [], null: false, array: true
  384. t.index ["account_id"], name: "index_users_on_account_id"
  385. t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
  386. t.index ["email"], name: "index_users_on_email", unique: true
  387. t.index ["filtered_languages"], name: "index_users_on_filtered_languages", using: :gin
  388. t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
  389. end
  390. create_table "web_push_subscriptions", force: :cascade do |t|
  391. t.string "endpoint", null: false
  392. t.string "key_p256dh", null: false
  393. t.string "key_auth", null: false
  394. t.json "data"
  395. t.datetime "created_at", null: false
  396. t.datetime "updated_at", null: false
  397. end
  398. create_table "web_settings", force: :cascade do |t|
  399. t.bigint "user_id"
  400. t.json "data"
  401. t.datetime "created_at", null: false
  402. t.datetime "updated_at", null: false
  403. t.index ["user_id"], name: "index_web_settings_on_user_id", unique: true
  404. end
  405. add_foreign_key "account_domain_blocks", "accounts", on_delete: :cascade
  406. add_foreign_key "blocks", "accounts", column: "target_account_id", on_delete: :cascade
  407. add_foreign_key "blocks", "accounts", on_delete: :cascade
  408. add_foreign_key "conversation_mutes", "accounts", on_delete: :cascade
  409. add_foreign_key "conversation_mutes", "conversations", on_delete: :cascade
  410. add_foreign_key "favourites", "accounts", on_delete: :cascade
  411. add_foreign_key "favourites", "statuses", on_delete: :cascade
  412. add_foreign_key "follow_requests", "accounts", column: "target_account_id", on_delete: :cascade
  413. add_foreign_key "follow_requests", "accounts", on_delete: :cascade
  414. add_foreign_key "follows", "accounts", column: "target_account_id", on_delete: :cascade
  415. add_foreign_key "follows", "accounts", on_delete: :cascade
  416. add_foreign_key "imports", "accounts", on_delete: :cascade
  417. add_foreign_key "media_attachments", "accounts", on_delete: :nullify
  418. add_foreign_key "media_attachments", "statuses", on_delete: :nullify
  419. add_foreign_key "mentions", "accounts", on_delete: :cascade
  420. add_foreign_key "mentions", "statuses", on_delete: :cascade
  421. add_foreign_key "mutes", "accounts", column: "target_account_id", on_delete: :cascade
  422. add_foreign_key "mutes", "accounts", on_delete: :cascade
  423. add_foreign_key "notifications", "accounts", column: "from_account_id", on_delete: :cascade
  424. add_foreign_key "notifications", "accounts", on_delete: :cascade
  425. add_foreign_key "oauth_access_grants", "oauth_applications", column: "application_id", on_delete: :cascade
  426. add_foreign_key "oauth_access_grants", "users", column: "resource_owner_id", on_delete: :cascade
  427. add_foreign_key "oauth_access_tokens", "oauth_applications", column: "application_id", on_delete: :cascade
  428. add_foreign_key "oauth_access_tokens", "users", column: "resource_owner_id", on_delete: :cascade
  429. add_foreign_key "oauth_applications", "users", column: "owner_id", on_delete: :cascade
  430. add_foreign_key "reports", "accounts", column: "action_taken_by_account_id", on_delete: :nullify
  431. add_foreign_key "reports", "accounts", column: "target_account_id", on_delete: :cascade
  432. add_foreign_key "reports", "accounts", on_delete: :cascade
  433. add_foreign_key "session_activations", "oauth_access_tokens", column: "access_token_id", on_delete: :cascade
  434. add_foreign_key "session_activations", "users", on_delete: :cascade
  435. add_foreign_key "status_pins", "accounts", on_delete: :cascade
  436. add_foreign_key "status_pins", "statuses", on_delete: :cascade
  437. add_foreign_key "statuses", "accounts", column: "in_reply_to_account_id", on_delete: :nullify
  438. add_foreign_key "statuses", "accounts", on_delete: :cascade
  439. add_foreign_key "statuses", "statuses", column: "in_reply_to_id", on_delete: :nullify
  440. add_foreign_key "statuses", "statuses", column: "reblog_of_id", on_delete: :cascade
  441. add_foreign_key "statuses_tags", "statuses", on_delete: :cascade
  442. add_foreign_key "statuses_tags", "tags", on_delete: :cascade
  443. add_foreign_key "stream_entries", "accounts", on_delete: :cascade
  444. add_foreign_key "subscriptions", "accounts", on_delete: :cascade
  445. add_foreign_key "users", "accounts", on_delete: :cascade
  446. add_foreign_key "web_settings", "users", on_delete: :cascade
  447. end