From 820914f3fd79c4f663bb820079740e6a8549ff4b Mon Sep 17 00:00:00 2001 From: Brian Austin <13002992+brianjaustin@users.noreply.github.com> Date: Fri, 1 Dec 2023 03:15:07 -0500 Subject: [PATCH] AO3-6639 Output current DB schema (#4669) * AO3-6639 Output current DB schema * Default is now used, remove explicit * Pull from prod * Revert "Pull from prod" This reverts commit 6e4a835d8fd8b496f5279939f542391eee037fca. * Disable schema update in prod/stage * SQL structure dump --- config/application.rb | 3 - config/environments/production.rb | 3 + config/environments/staging.rb | 3 + db/schema.rb | 267 ++++--- db/structure.sql | 1130 +++++++++++++++-------------- 5 files changed, 750 insertions(+), 656 deletions(-) diff --git a/config/application.rb b/config/application.rb index 3b62231c19d..692c5754b0e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -66,9 +66,6 @@ class Application < Rails::Application # Configure sensitive parameters which will be filtered from the log file. config.filter_parameters += [:content, :password, :terms_of_service_non_production] - # Disable dumping schemas after migrations. - config.active_record.dump_schema_after_migration = false - # Allows belongs_to associations to be optional config.active_record.belongs_to_required_by_default = false diff --git a/config/environments/production.rb b/config/environments/production.rb index 31aeb442dfe..a477624ed03 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -53,4 +53,7 @@ config.active_support.deprecation = :notify config.middleware.use Rack::Attack + + # Disable dumping schemas after migrations. + config.active_record.dump_schema_after_migration = false end diff --git a/config/environments/staging.rb b/config/environments/staging.rb index d3bb9433386..a19d6a60c5e 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -69,4 +69,7 @@ end config.middleware.use Rack::Attack + + # Disable dumping schemas after migrations. + config.active_record.dump_schema_after_migration = false end diff --git a/db/schema.rb b/db/schema.rb index 93293954335..1d41c73abab 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2,17 +2,17 @@ # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20201214013251) do +ActiveRecord::Schema.define(version: 2023_09_20_094945) do - create_table "abuse_reports", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "abuse_reports", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.string "email" t.string "url", null: false t.text "comment", null: false @@ -26,7 +26,7 @@ t.string "username" end - create_table "admin_activities", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "admin_activities", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "admin_id" t.integer "target_id" t.string "target_type" @@ -37,21 +37,21 @@ t.datetime "updated_at" end - create_table "admin_banners", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "admin_banners", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.text "content" t.integer "content_sanitizer_version", limit: 2, default: 0, null: false t.string "banner_type" t.boolean "active", default: false, null: false end - create_table "admin_blacklisted_emails", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "admin_blacklisted_emails", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.string "email" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["email"], name: "index_admin_blacklisted_emails_on_email", unique: true end - create_table "admin_post_taggings", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "admin_post_taggings", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "admin_post_tag_id" t.integer "admin_post_id" t.datetime "created_at" @@ -59,14 +59,14 @@ t.index ["admin_post_id"], name: "index_admin_post_taggings_on_admin_post_id" end - create_table "admin_post_tags", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "admin_post_tags", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.string "name" t.integer "language_id" t.datetime "created_at" t.datetime "updated_at" end - create_table "admin_posts", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "admin_posts", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "admin_id" t.string "title" t.text "content" @@ -80,7 +80,7 @@ t.index ["translated_post_id"], name: "index_admin_posts_on_post_id" end - create_table "admin_settings", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "admin_settings", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.boolean "account_creation_enabled", default: true, null: false t.boolean "invite_from_queue_enabled", default: true, null: false t.bigint "invite_from_queue_number" @@ -103,10 +103,11 @@ t.boolean "disable_support_form", default: false, null: false t.text "disabled_support_form_text" t.integer "disabled_support_form_text_sanitizer_version", limit: 2, default: 0, null: false + t.boolean "guest_comments_off", default: false, null: false t.index ["last_updated_by"], name: "index_admin_settings_on_last_updated_by" end - create_table "admins", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "admins", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.datetime "created_at" t.datetime "updated_at" t.string "email" @@ -114,11 +115,15 @@ t.string "encrypted_password" t.string "password_salt" t.text "roles" + t.string "reset_password_token" + t.datetime "reset_password_sent_at" + t.datetime "locked_at" t.index ["email"], name: "index_admins_on_email", unique: true t.index ["login"], name: "index_admins_on_login", unique: true + t.index ["reset_password_token"], name: "index_admins_on_reset_password_token", unique: true end - create_table "api_keys", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "api_keys", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.string "name", null: false t.string "access_token", null: false t.boolean "banned", default: false, null: false @@ -128,7 +133,7 @@ t.index ["name"], name: "index_api_keys_on_name", unique: true end - create_table "archive_faq_translations", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "archive_faq_translations", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "archive_faq_id" t.string "locale", null: false t.datetime "created_at", null: false @@ -138,7 +143,7 @@ t.index ["locale"], name: "index_archive_faq_translations_on_locale" end - create_table "archive_faqs", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "archive_faqs", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "admin_id" t.string "title" t.datetime "updated_at" @@ -149,7 +154,7 @@ t.index ["slug"], name: "index_archive_faqs_on_slug", unique: true end - create_table "audits", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "audits", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "auditable_id" t.string "auditable_type" t.integer "associated_id" @@ -167,11 +172,22 @@ t.index ["associated_id", "associated_type"], name: "associated_index" t.index ["auditable_id", "auditable_type"], name: "auditable_index" t.index ["created_at"], name: "index_audits_on_created_at" + t.index ["remote_address"], name: "index_audits_on_remote_address" t.index ["request_uuid"], name: "index_audits_on_request_uuid" t.index ["user_id", "user_type"], name: "user_index" end - create_table "bookmarks", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "blocks", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| + t.bigint "blocker_id" + t.bigint "blocked_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["blocked_id"], name: "index_blocks_on_blocked_id" + t.index ["blocker_id", "blocked_id"], name: "index_blocks_on_blocker_id_and_blocked_id", unique: true + t.index ["blocker_id"], name: "index_blocks_on_blocker_id" + end + + create_table "bookmarks", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.datetime "created_at", null: false t.string "bookmarkable_type", limit: 15, null: false t.integer "bookmarkable_id", null: false @@ -190,7 +206,7 @@ t.index ["user_id"], name: "fk_bookmarks_user" end - create_table "challenge_assignments", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "challenge_assignments", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "collection_id" t.integer "creation_id" t.string "creation_type" @@ -213,7 +229,7 @@ t.index ["sent_at"], name: "assignments_on_offer_sent_at" end - create_table "challenge_claims", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "challenge_claims", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "collection_id" t.integer "creation_id" t.string "creation_type" @@ -231,7 +247,7 @@ t.index ["request_signup_id"], name: "index_challenge_claims_on_request_signup_id" end - create_table "challenge_signups", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "challenge_signups", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "collection_id" t.integer "pseud_id" t.datetime "created_at" @@ -242,8 +258,8 @@ t.index ["pseud_id"], name: "signups_on_pseud_id" end - create_table "chapters", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| - t.text "content", limit: 4294967295, null: false, collation: "utf8mb4_unicode_ci" + create_table "chapters", id: :integer, charset: "utf8", force: :cascade do |t| + t.text "content", size: :long, null: false, collation: "utf8mb4_unicode_ci" t.integer "position", default: 1 t.integer "work_id" t.datetime "created_at" @@ -264,7 +280,7 @@ t.index ["work_id"], name: "works_chapter_index" end - create_table "collection_items", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "collection_items", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "collection_id" t.integer "item_id" t.string "item_type", default: "Work" @@ -281,7 +297,7 @@ t.index ["unrevealed"], name: "collection_items_unrevealed" end - create_table "collection_participants", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "collection_participants", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "collection_id" t.integer "pseud_id" t.string "participant_role", default: "None", null: false @@ -292,7 +308,7 @@ t.index ["pseud_id"], name: "participants_pseud_id" end - create_table "collection_preferences", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "collection_preferences", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "collection_id" t.datetime "created_at" t.datetime "updated_at" @@ -307,11 +323,11 @@ t.index ["collection_id"], name: "index_collection_preferences_on_collection_id" end - create_table "collection_profiles", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "collection_profiles", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "collection_id" - t.text "intro", limit: 16777215 - t.text "faq", limit: 16777215 - t.text "rules", limit: 16777215 + t.text "intro", size: :medium + t.text "faq", size: :medium + t.text "rules", size: :medium t.datetime "created_at" t.datetime "updated_at" t.text "gift_notification" @@ -322,7 +338,7 @@ t.index ["collection_id"], name: "index_collection_profiles_on_collection_id" end - create_table "collections", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "collections", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.string "name" t.string "title" t.string "email" @@ -346,7 +362,7 @@ t.index ["parent_id"], name: "index_collections_on_parent_id" end - create_table "comments", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "comments", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "pseud_id" t.text "comment_content", null: false t.integer "depth" @@ -371,13 +387,14 @@ t.boolean "unreviewed", default: false, null: false t.boolean "iced", default: false, null: false t.index ["commentable_id", "commentable_type"], name: "index_comments_commentable" + t.index ["email"], name: "index_comments_on_email" t.index ["ip_address"], name: "index_comments_on_ip_address" t.index ["parent_id", "parent_type"], name: "index_comments_parent" t.index ["pseud_id"], name: "index_comments_on_pseud_id" t.index ["thread"], name: "comments_by_thread" end - create_table "common_taggings", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "common_taggings", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "common_tag_id", null: false t.integer "filterable_id", null: false t.string "filterable_type", limit: 100 @@ -387,7 +404,7 @@ t.index ["filterable_id"], name: "index_common_taggings_on_filterable_id" end - create_table "creatorships", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "creatorships", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "creation_id" t.string "creation_type", limit: 100 t.integer "pseud_id" @@ -398,7 +415,7 @@ t.index ["pseud_id"], name: "index_creatorships_pseud" end - create_table "delayed_jobs", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "delayed_jobs", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "priority", default: 0 t.integer "attempts", default: 0 t.text "handler" @@ -415,7 +432,7 @@ t.index ["run_at"], name: "delayed_jobs_run_at" end - create_table "external_author_names", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "external_author_names", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "external_author_id", null: false t.string "name" t.datetime "created_at" @@ -423,7 +440,7 @@ t.index ["external_author_id"], name: "index_external_author_names_on_external_author_id" end - create_table "external_authors", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "external_authors", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.string "email" t.boolean "is_claimed", default: false, null: false t.integer "user_id" @@ -435,7 +452,7 @@ t.index ["user_id"], name: "index_external_authors_on_user_id" end - create_table "external_creatorships", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "external_creatorships", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "creation_id" t.string "creation_type" t.datetime "created_at" @@ -447,7 +464,7 @@ t.index ["external_author_name_id"], name: "index_external_creatorships_on_external_author_name_id" end - create_table "external_works", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "external_works", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.string "url", null: false t.string "author", null: false t.boolean "dead", default: false, null: false @@ -460,20 +477,20 @@ t.integer "language_id" end - create_table "fannish_next_of_kins", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "fannish_next_of_kins", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "user_id" t.integer "kin_id" t.string "kin_email" t.index ["user_id"], name: "index_fannish_next_of_kins_on_user_id" end - create_table "favorite_tags", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "favorite_tags", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "user_id" t.integer "tag_id" t.index ["user_id", "tag_id"], name: "index_favorite_tags_on_user_id_and_tag_id", unique: true end - create_table "feedbacks", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "feedbacks", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.text "comment", null: false t.datetime "created_at" t.datetime "updated_at" @@ -483,13 +500,12 @@ t.string "category" t.integer "comment_sanitizer_version", limit: 2, default: 0, null: false t.integer "summary_sanitizer_version", limit: 2, default: 0, null: false - t.string "ip_address" t.string "username" t.string "language" t.string "rollout" end - create_table "filter_counts", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "filter_counts", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.bigint "filter_id", null: false t.bigint "public_works_count", default: 0 t.bigint "unhidden_works_count", default: 0 @@ -500,7 +516,7 @@ t.index ["unhidden_works_count"], name: "index_unhidden_works_count" end - create_table "filter_taggings", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "filter_taggings", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.bigint "filter_id", null: false t.bigint "filterable_id", null: false t.string "filterable_type", limit: 100 @@ -511,7 +527,7 @@ t.index ["filterable_id", "filterable_type"], name: "index_filter_taggings_filterable" end - create_table "gift_exchanges", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "gift_exchanges", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "request_restriction_id" t.integer "offer_restriction_id" t.integer "requests_num_required", default: 1, null: false @@ -529,7 +545,6 @@ t.datetime "assignments_due_at" t.datetime "works_reveal_at" t.datetime "authors_reveal_at" - t.integer "prompt_restriction_id" t.string "request_url_label" t.string "request_description_label" t.string "offer_url_label" @@ -543,7 +558,7 @@ t.boolean "requests_summary_visible", default: false, null: false end - create_table "gifts", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "gifts", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "work_id" t.string "recipient_name" t.datetime "created_at" @@ -555,7 +570,7 @@ t.index ["work_id"], name: "index_gifts_on_work_id" end - create_table "inbox_comments", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "inbox_comments", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "user_id" t.integer "feedback_comment_id" t.datetime "created_at" @@ -567,11 +582,7 @@ t.index ["user_id"], name: "index_inbox_comments_on_user_id" end - create_table "innodb_monitor", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| - t.integer "a" - end - - create_table "invitations", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "invitations", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "creator_id" t.string "invitee_email" t.string "token" @@ -591,9 +602,8 @@ t.index ["token"], name: "index_invitations_on_token" end - create_table "invite_requests", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "invite_requests", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.string "email" - t.integer "position" t.datetime "created_at" t.datetime "updated_at" t.string "simplified_email", default: "", null: false @@ -602,7 +612,7 @@ t.index ["simplified_email"], name: "index_invite_requests_on_simplified_email", unique: true end - create_table "known_issues", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "known_issues", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "admin_id" t.string "title" t.text "content" @@ -611,7 +621,7 @@ t.integer "content_sanitizer_version", limit: 2, default: 0, null: false end - create_table "kudos", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "kudos", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "commentable_id" t.string "commentable_type", collation: "utf8_general_ci" t.datetime "created_at" @@ -624,7 +634,7 @@ t.index ["user_id"], name: "index_kudos_on_user_id" end - create_table "languages", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "languages", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.string "short", limit: 4 t.string "name" t.boolean "support_available", default: false, null: false @@ -634,7 +644,14 @@ t.index ["sortable_name"], name: "index_languages_on_sortable_name" end - create_table "locales", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "last_wrangling_activities", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| + t.bigint "user_id", null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["user_id"], name: "index_last_wrangling_activities_on_user_id", unique: true + end + + create_table "locales", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.string "iso" t.string "short" t.string "name" @@ -648,7 +665,7 @@ t.index ["short"], name: "index_locales_on_short" end - create_table "log_items", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "log_items", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "user_id", null: false t.integer "admin_id" t.integer "role_id" @@ -658,12 +675,13 @@ t.datetime "created_at" t.datetime "updated_at" t.integer "note_sanitizer_version", limit: 2, default: 0, null: false + t.integer "fnok_user_id" t.index ["admin_id"], name: "index_log_items_on_admin_id" t.index ["role_id"], name: "index_log_items_on_role_id" t.index ["user_id"], name: "index_log_items_on_user_id" end - create_table "meta_taggings", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "meta_taggings", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.bigint "meta_tag_id", null: false t.bigint "sub_tag_id", null: false t.boolean "direct", default: true @@ -673,7 +691,7 @@ t.index ["sub_tag_id"], name: "index_meta_taggings_on_sub_tag_id" end - create_table "moderated_works", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "moderated_works", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.bigint "work_id", null: false t.boolean "approved", default: false, null: false t.boolean "reviewed", default: false, null: false @@ -682,22 +700,17 @@ t.index ["work_id"], name: "index_moderated_works_on_work_id" end - create_table "open_id_authentication_associations", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| - t.integer "issued" - t.integer "lifetime" - t.string "handle" - t.string "assoc_type" - t.binary "server_url" - t.binary "secret" - end - - create_table "open_id_authentication_nonces", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| - t.integer "timestamp", null: false - t.string "server_url" - t.string "salt", null: false + create_table "mutes", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| + t.bigint "muter_id" + t.bigint "muted_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["muted_id"], name: "index_mutes_on_muted_id" + t.index ["muter_id", "muted_id"], name: "index_mutes_on_muter_id_and_muted_id", unique: true + t.index ["muter_id"], name: "index_mutes_on_muter_id" end - create_table "owned_set_taggings", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "owned_set_taggings", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "owned_tag_set_id" t.integer "set_taggable_id" t.string "set_taggable_type", limit: 100 @@ -705,7 +718,7 @@ t.datetime "updated_at" end - create_table "owned_tag_sets", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "owned_tag_sets", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "tag_set_id" t.boolean "visible", default: false, null: false t.boolean "nominated", default: false, null: false @@ -722,7 +735,7 @@ t.boolean "usable", default: false, null: false end - create_table "potential_match_settings", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "potential_match_settings", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "num_required_prompts", default: 1, null: false t.integer "num_required_fandoms", default: 0, null: false t.integer "num_required_characters", default: 0, null: false @@ -742,7 +755,7 @@ t.datetime "updated_at" end - create_table "potential_matches", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "potential_matches", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "collection_id" t.integer "offer_signup_id" t.integer "request_signup_id" @@ -756,7 +769,7 @@ t.index ["request_signup_id"], name: "index_potential_matches_on_request_signup_id" end - create_table "preferences", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "preferences", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "user_id" t.boolean "history_enabled", default: true t.boolean "email_visible", default: false @@ -772,7 +785,6 @@ t.string "work_title_format", default: "TITLE - AUTHOR - FANDOM" t.boolean "hide_freeform", default: false, null: false t.boolean "first_login", default: true - t.boolean "automatically_approve_collections", default: false, null: false t.boolean "collection_emails_off", default: false, null: false t.boolean "collection_inbox_off", default: false, null: false t.boolean "recipient_emails_off", default: false, null: false @@ -787,11 +799,14 @@ t.boolean "banner_seen", default: false, null: false t.integer "preferred_locale", default: 1, null: false t.boolean "allow_cocreator", default: false + t.boolean "allow_gifts", default: false + t.boolean "allow_collection_invitation", default: false, null: false + t.boolean "guest_replies_off", default: false, null: false t.index ["skin_id"], name: "index_preferences_on_skin_id" t.index ["user_id"], name: "index_preferences_on_user_id" end - create_table "profiles", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "profiles", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "user_id" t.string "location" t.text "about_me" @@ -803,8 +818,7 @@ t.index ["user_id"], name: "index_profiles_on_user_id" end - create_table "prompt_memes", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| - t.integer "prompt_restriction_id" + create_table "prompt_memes", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "request_restriction_id" t.integer "requests_num_required", default: 1, null: false t.integer "requests_num_allowed", default: 5, null: false @@ -826,7 +840,7 @@ t.boolean "anonymous", default: false, null: false end - create_table "prompt_restrictions", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "prompt_restrictions", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "tag_set_id" t.boolean "optional_tags_allowed", default: false, null: false t.boolean "description_allowed", default: true, null: false @@ -871,7 +885,7 @@ t.boolean "title_allowed", default: false, null: false end - create_table "prompts", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "prompts", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "collection_id" t.integer "challenge_signup_id" t.integer "pseud_id" @@ -900,7 +914,7 @@ t.index ["type"], name: "index_prompts_on_type" end - create_table "pseuds", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "pseuds", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "user_id" t.string "name", null: false t.text "description" @@ -919,7 +933,7 @@ t.index ["user_id", "name"], name: "index_pseuds_on_user_id_and_name" end - create_table "question_translations", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "question_translations", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "question_id" t.string "locale", null: false t.datetime "created_at", null: false @@ -933,7 +947,7 @@ t.index ["question_id"], name: "index_question_translations_on_question_id" end - create_table "questions", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "questions", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "archive_faq_id" t.string "question" t.text "content" @@ -945,7 +959,7 @@ t.index ["archive_faq_id", "position"], name: "index_questions_on_archive_faq_id_and_position" end - create_table "readings", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "readings", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "major_version_read" t.integer "minor_version_read" t.integer "user_id" @@ -959,7 +973,7 @@ t.index ["work_id"], name: "index_readings_on_work_id" end - create_table "related_works", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "related_works", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "parent_id" t.string "parent_type" t.integer "work_id" @@ -971,7 +985,7 @@ t.index ["work_id"], name: "index_related_works_on_work_id" end - create_table "roles", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "roles", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.string "name", limit: 40 t.string "authorizable_type", limit: 40 t.integer "authorizable_id" @@ -982,7 +996,7 @@ t.index ["name"], name: "index_roles_on_name" end - create_table "roles_users", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + create_table "roles_users", charset: "utf8", force: :cascade do |t| t.integer "user_id" t.integer "role_id" t.datetime "created_at" @@ -991,7 +1005,7 @@ t.index ["user_id", "role_id"], name: "index_roles_users_on_user_id_and_role_id" end - create_table "searches", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "searches", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "user_id" t.string "name" t.text "options" @@ -1000,7 +1014,7 @@ t.datetime "updated_at" end - create_table "serial_works", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "serial_works", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "series_id" t.integer "work_id" t.integer "position", default: 1 @@ -1010,7 +1024,7 @@ t.index ["work_id"], name: "index_serial_works_on_work_id" end - create_table "series", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "series", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.datetime "created_at" t.datetime "updated_at" t.string "title", null: false @@ -1023,7 +1037,7 @@ t.integer "series_notes_sanitizer_version", limit: 2, default: 0, null: false end - create_table "set_taggings", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "set_taggings", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "tag_id" t.integer "tag_set_id" t.datetime "created_at" @@ -1032,7 +1046,7 @@ t.index ["tag_set_id"], name: "index_set_taggings_on_tag_set_id" end - create_table "skin_parents", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "skin_parents", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "child_skin_id" t.integer "parent_skin_id" t.integer "position" @@ -1040,7 +1054,7 @@ t.datetime "updated_at" end - create_table "skins", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "skins", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.string "title" t.integer "author_id" t.text "css" @@ -1083,7 +1097,7 @@ t.index ["type"], name: "index_skins_on_type" end - create_table "stat_counters", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "stat_counters", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "work_id" t.integer "hit_count", default: 0, null: false t.integer "download_count", default: 0, null: false @@ -1094,7 +1108,7 @@ t.index ["work_id"], name: "index_hit_counters_on_work_id", unique: true end - create_table "subscriptions", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "subscriptions", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "user_id" t.integer "subscribable_id" t.string "subscribable_type" @@ -1104,7 +1118,7 @@ t.index ["user_id"], name: "user_id" end - create_table "tag_nominations", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "tag_nominations", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.string "type" t.integer "tag_set_nomination_id" t.integer "fandom_nomination_id" @@ -1118,6 +1132,7 @@ t.boolean "exists", default: false, null: false t.boolean "parented", default: false, null: false t.string "synonym" + t.index ["tag_set_nomination_id", "type"], name: "index_tag_nominations_on_tag_set_nomination_id_and_type" t.index ["tagname"], name: "index_tag_nominations_on_tagname" t.index ["type", "fandom_nomination_id"], name: "index_tag_nominations_on_type_and_fandom_nomination_id" t.index ["type", "synonym"], name: "index_tag_nominations_on_type_and_synonym" @@ -1125,22 +1140,27 @@ t.index ["type", "tagname"], name: "index_tag_nominations_on_type_and_tagname" end - create_table "tag_set_associations", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "tag_set_associations", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "owned_tag_set_id" t.integer "tag_id" t.integer "parent_tag_id" t.datetime "created_at" t.datetime "updated_at" + t.index ["owned_tag_set_id", "parent_tag_id", "tag_id"], name: "index_tag_set_associations_on_tag_set_and_parent_and_tag", unique: true + t.index ["parent_tag_id"], name: "index_tag_set_associations_on_parent_tag_id" + t.index ["tag_id"], name: "index_tag_set_associations_on_tag_id" end - create_table "tag_set_nominations", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "tag_set_nominations", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "pseud_id" t.integer "owned_tag_set_id" t.datetime "created_at" t.datetime "updated_at" + t.index ["owned_tag_set_id"], name: "index_tag_set_nominations_on_owned_tag_set_id" + t.index ["pseud_id", "owned_tag_set_id"], name: "index_tag_set_nominations_on_pseud_id_and_owned_tag_set_id" end - create_table "tag_set_ownerships", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "tag_set_ownerships", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "pseud_id" t.integer "owned_tag_set_id" t.boolean "owner", default: false, null: false @@ -1148,12 +1168,12 @@ t.datetime "updated_at" end - create_table "tag_sets", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "tag_sets", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.datetime "created_at" t.datetime "updated_at" end - create_table "taggings", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "taggings", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "tagger_id" t.integer "taggable_id", null: false t.string "taggable_type", limit: 100, default: "" @@ -1164,7 +1184,7 @@ t.index ["tagger_id", "tagger_type", "taggable_id", "taggable_type"], name: "index_taggings_polymorphic", unique: true end - create_table "tags", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "tags", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.string "name", limit: 100, default: "" t.boolean "canonical", default: false, null: false t.datetime "created_at" @@ -1188,7 +1208,7 @@ t.index ["type"], name: "index_tags_on_type" end - create_table "user_invite_requests", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "user_invite_requests", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "user_id" t.integer "quantity" t.text "reason" @@ -1199,7 +1219,7 @@ t.index ["user_id"], name: "index_user_invite_requests_on_user_id" end - create_table "users", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "users", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.datetime "created_at" t.datetime "updated_at" t.string "email" @@ -1227,14 +1247,17 @@ t.string "unlock_token" t.datetime "locked_at" t.boolean "recently_reset" + t.datetime "renamed_at" + t.integer "resets_requested", default: 0, null: false t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true t.index ["email"], name: "index_users_on_email", unique: true t.index ["login"], name: "index_users_on_login", unique: true t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true + t.index ["resets_requested"], name: "index_users_on_resets_requested" t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true end - create_table "work_links", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "work_links", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "work_id" t.string "url" t.integer "count" @@ -1243,7 +1266,17 @@ t.index ["work_id", "url"], name: "work_links_work_id_url", unique: true end - create_table "works", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "work_original_creators", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| + t.bigint "work_id", null: false + t.bigint "user_id", null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["user_id"], name: "index_work_original_creators_on_user_id" + t.index ["work_id", "user_id"], name: "index_work_original_creators_on_work_id_and_user_id", unique: true + t.index ["work_id"], name: "index_work_original_creators_on_work_id" + end + + create_table "works", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "expected_number_of_chapters", default: 1 t.datetime "created_at" t.datetime "updated_at" @@ -1285,14 +1318,14 @@ t.index ["spam"], name: "index_works_on_spam" end - create_table "wrangling_assignments", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "wrangling_assignments", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "user_id" t.integer "fandom_id" t.index ["fandom_id"], name: "wrangling_assignments_by_fandom_id" t.index ["user_id"], name: "wrangling_assignments_by_user_id" end - create_table "wrangling_guidelines", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC", force: :cascade do |t| + create_table "wrangling_guidelines", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.integer "admin_id" t.string "title" t.text "content" diff --git a/db/structure.sql b/db/structure.sql index c5f17edadb7..b4d757b85cb 100755 --- a/db/structure.sql +++ b/db/structure.sql @@ -9,33 +9,22 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -/*!50717 SELECT COUNT(*) INTO @rocksdb_has_p_s_session_variables FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'performance_schema' AND TABLE_NAME = 'session_variables' */; -/*!50717 SET @rocksdb_get_is_supported = IF (@rocksdb_has_p_s_session_variables, 'SELECT COUNT(*) INTO @rocksdb_is_supported FROM performance_schema.session_variables WHERE VARIABLE_NAME=\'rocksdb_bulk_load\'', 'SELECT 0') */; -/*!50717 PREPARE s FROM @rocksdb_get_is_supported */; -/*!50717 EXECUTE s */; -/*!50717 DEALLOCATE PREPARE s */; -/*!50717 SET @rocksdb_enable_bulk_load = IF (@rocksdb_is_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @rocksdb_dummy_bulk_load = 0') */; -/*!50717 PREPARE s FROM @rocksdb_enable_bulk_load */; -/*!50717 EXECUTE s */; -/*!50717 DEALLOCATE PREPARE s */; -SET @MYSQLDUMP_TEMP_LOG_BIN = @@SESSION.SQL_LOG_BIN; -SET @@SESSION.SQL_LOG_BIN= 0; DROP TABLE IF EXISTS `abuse_reports`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `abuse_reports` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `url` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `comment` text COLLATE utf8mb4_unicode_ci NOT NULL, + `email` varchar(255) DEFAULT NULL, + `url` varchar(255) NOT NULL, + `comment` text NOT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `ip_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `comment_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `summary` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `summary_sanitizer_version` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `language` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `ip_address` varchar(255) DEFAULT NULL, + `comment_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `summary` varchar(255) DEFAULT NULL, + `summary_sanitizer_version` varchar(255) DEFAULT NULL, + `language` varchar(255) DEFAULT NULL, + `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; @@ -46,10 +35,10 @@ CREATE TABLE `admin_activities` ( `id` int(11) NOT NULL AUTO_INCREMENT, `admin_id` int(11) DEFAULT NULL, `target_id` int(11) DEFAULT NULL, - `target_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `action` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `summary` text COLLATE utf8mb4_unicode_ci, - `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', + `target_type` varchar(255) DEFAULT NULL, + `action` varchar(255) DEFAULT NULL, + `summary` text DEFAULT NULL, + `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) @@ -60,10 +49,10 @@ DROP TABLE IF EXISTS `admin_banners`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `admin_banners` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `content` text COLLATE utf8mb4_unicode_ci, - `content_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `banner_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `active` tinyint(1) NOT NULL DEFAULT '0', + `content` text DEFAULT NULL, + `content_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `banner_type` varchar(255) DEFAULT NULL, + `active` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; @@ -72,7 +61,7 @@ DROP TABLE IF EXISTS `admin_blacklisted_emails`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `admin_blacklisted_emails` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`), @@ -97,7 +86,7 @@ DROP TABLE IF EXISTS `admin_post_tags`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `admin_post_tags` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, `language_id` int(11) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, @@ -110,14 +99,14 @@ DROP TABLE IF EXISTS `admin_posts`; CREATE TABLE `admin_posts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `admin_id` int(11) DEFAULT NULL, - `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `content` text COLLATE utf8mb4_unicode_ci, + `title` varchar(255) DEFAULT NULL, + `content` text DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `created_at` datetime DEFAULT NULL, - `content_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', + `content_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, `translated_post_id` int(11) DEFAULT NULL, `language_id` int(11) DEFAULT NULL, - `comment_permissions` tinyint(4) NOT NULL DEFAULT '0', + `comment_permissions` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `index_admin_posts_on_post_id` (`translated_post_id`), KEY `index_admin_posts_on_created_at` (`created_at`) @@ -128,8 +117,8 @@ DROP TABLE IF EXISTS `admin_settings`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `admin_settings` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `account_creation_enabled` tinyint(1) NOT NULL DEFAULT '1', - `invite_from_queue_enabled` tinyint(1) NOT NULL DEFAULT '1', + `account_creation_enabled` tinyint(1) NOT NULL DEFAULT 1, + `invite_from_queue_enabled` tinyint(1) NOT NULL DEFAULT 1, `invite_from_queue_number` bigint(20) DEFAULT NULL, `invite_from_queue_frequency` mediumint(9) DEFAULT NULL, `days_to_purge_unactivated` mediumint(9) DEFAULT NULL, @@ -137,19 +126,20 @@ CREATE TABLE `admin_settings` ( `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `invite_from_queue_at` datetime DEFAULT '2009-11-07 21:27:21', - `suspend_filter_counts` tinyint(1) DEFAULT '0', + `suspend_filter_counts` tinyint(1) DEFAULT 0, `suspend_filter_counts_at` datetime DEFAULT NULL, - `enable_test_caching` tinyint(1) DEFAULT '0', - `cache_expiration` bigint(20) DEFAULT '10', - `tag_wrangling_off` tinyint(1) NOT NULL DEFAULT '0', + `enable_test_caching` tinyint(1) DEFAULT 0, + `cache_expiration` bigint(20) DEFAULT 10, + `tag_wrangling_off` tinyint(1) NOT NULL DEFAULT 0, `default_skin_id` int(11) DEFAULT NULL, - `request_invite_enabled` tinyint(1) NOT NULL DEFAULT '0', - `creation_requires_invite` tinyint(1) NOT NULL DEFAULT '0', - `downloads_enabled` tinyint(1) DEFAULT '1', - `hide_spam` tinyint(1) NOT NULL DEFAULT '0', - `disable_support_form` tinyint(1) NOT NULL DEFAULT '0', - `disabled_support_form_text` text COLLATE utf8mb4_unicode_ci, - `disabled_support_form_text_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', + `request_invite_enabled` tinyint(1) NOT NULL DEFAULT 0, + `creation_requires_invite` tinyint(1) NOT NULL DEFAULT 0, + `downloads_enabled` tinyint(1) DEFAULT 1, + `hide_spam` tinyint(1) NOT NULL DEFAULT 0, + `disable_support_form` tinyint(1) NOT NULL DEFAULT 0, + `disabled_support_form_text` text DEFAULT NULL, + `disabled_support_form_text_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `guest_comments_off` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `index_admin_settings_on_last_updated_by` (`last_updated_by`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; @@ -161,14 +151,18 @@ CREATE TABLE `admins` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `login` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `encrypted_password` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `password_salt` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `roles` text COLLATE utf8mb4_unicode_ci, + `email` varchar(255) DEFAULT NULL, + `login` varchar(255) DEFAULT NULL, + `encrypted_password` varchar(255) DEFAULT NULL, + `password_salt` varchar(255) DEFAULT NULL, + `roles` text DEFAULT NULL, + `reset_password_token` varchar(255) DEFAULT NULL, + `reset_password_sent_at` datetime DEFAULT NULL, + `locked_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `index_admins_on_email` (`email`), - UNIQUE KEY `index_admins_on_login` (`login`) + UNIQUE KEY `index_admins_on_login` (`login`), + UNIQUE KEY `index_admins_on_reset_password_token` (`reset_password_token`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `api_keys`; @@ -176,9 +170,9 @@ DROP TABLE IF EXISTS `api_keys`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `api_keys` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `access_token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `banned` tinyint(1) NOT NULL DEFAULT '0', + `name` varchar(255) NOT NULL, + `access_token` varchar(255) NOT NULL, + `banned` tinyint(1) NOT NULL DEFAULT 0, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`), @@ -190,8 +184,8 @@ DROP TABLE IF EXISTS `ar_internal_metadata`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ar_internal_metadata` ( - `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `value` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `key` varchar(255) NOT NULL, + `value` varchar(255) DEFAULT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`key`) @@ -203,10 +197,10 @@ DROP TABLE IF EXISTS `archive_faq_translations`; CREATE TABLE `archive_faq_translations` ( `id` int(11) NOT NULL AUTO_INCREMENT, `archive_faq_id` int(11) DEFAULT NULL, - `locale` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `locale` varchar(255) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, - `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `title` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_archive_faq_translations_on_archive_faq_id` (`archive_faq_id`), KEY `index_archive_faq_translations_on_locale` (`locale`) @@ -218,11 +212,11 @@ DROP TABLE IF EXISTS `archive_faqs`; CREATE TABLE `archive_faqs` ( `id` int(11) NOT NULL AUTO_INCREMENT, `admin_id` int(11) DEFAULT NULL, - `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `title` varchar(255) DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `created_at` datetime DEFAULT NULL, - `position` int(11) DEFAULT '1', - `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', + `position` int(11) DEFAULT 1, + `slug` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `index_archive_faqs_on_slug` (`slug`), KEY `index_archive_faqs_on_position` (`position`) @@ -234,44 +228,60 @@ DROP TABLE IF EXISTS `audits`; CREATE TABLE `audits` ( `id` int(11) NOT NULL AUTO_INCREMENT, `auditable_id` int(11) DEFAULT NULL, - `auditable_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `auditable_type` varchar(255) DEFAULT NULL, `associated_id` int(11) DEFAULT NULL, - `associated_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `associated_type` varchar(255) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, - `user_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `action` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `audited_changes` text COLLATE utf8mb4_unicode_ci, - `version` int(11) DEFAULT '0', - `comment` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `remote_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_at` datetime DEFAULT NULL, - `request_uuid` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_type` varchar(255) DEFAULT NULL, + `username` varchar(255) DEFAULT NULL, + `action` varchar(255) DEFAULT NULL, + `audited_changes` text DEFAULT NULL, + `version` int(11) DEFAULT 0, + `comment` varchar(255) DEFAULT NULL, + `remote_address` varchar(255) DEFAULT NULL, + `created_at` datetime DEFAULT NULL, + `request_uuid` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `auditable_index` (`auditable_id`,`auditable_type`), KEY `associated_index` (`associated_id`,`associated_type`), KEY `user_index` (`user_id`,`user_type`), KEY `index_audits_on_created_at` (`created_at`), - KEY `index_audits_on_request_uuid` (`request_uuid`) + KEY `index_audits_on_request_uuid` (`request_uuid`), + KEY `index_audits_on_remote_address` (`remote_address`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `blocks`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `blocks` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `blocker_id` bigint(20) DEFAULT NULL, + `blocked_id` bigint(20) DEFAULT NULL, + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `index_blocks_on_blocker_id_and_blocked_id` (`blocker_id`,`blocked_id`), + KEY `index_blocks_on_blocker_id` (`blocker_id`), + KEY `index_blocks_on_blocked_id` (`blocked_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `bookmarks`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `bookmarks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created_at` datetime NOT NULL, - `bookmarkable_type` varchar(15) COLLATE utf8mb4_unicode_ci NOT NULL, + `bookmarkable_type` varchar(15) NOT NULL, `bookmarkable_id` int(11) NOT NULL, `user_id` int(11) DEFAULT NULL, - `bookmarker_notes` text COLLATE utf8mb4_unicode_ci, - `private` tinyint(1) DEFAULT '0', + `bookmarker_notes` text DEFAULT NULL, + `private` tinyint(1) DEFAULT 0, `updated_at` datetime DEFAULT NULL, - `hidden_by_admin` tinyint(1) NOT NULL DEFAULT '0', + `hidden_by_admin` tinyint(1) NOT NULL DEFAULT 0, `pseud_id` int(11) NOT NULL, - `rec` tinyint(1) NOT NULL DEFAULT '0', - `delta` tinyint(1) DEFAULT '1', - `bookmarker_notes_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', + `rec` tinyint(1) NOT NULL DEFAULT 0, + `delta` tinyint(1) DEFAULT 1, + `bookmarker_notes_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `fk_bookmarks_user` (`user_id`), KEY `index_bookmarks_on_pseud_id` (`pseud_id`), @@ -286,7 +296,7 @@ CREATE TABLE `challenge_assignments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `collection_id` int(11) DEFAULT NULL, `creation_id` int(11) DEFAULT NULL, - `creation_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `creation_type` varchar(255) DEFAULT NULL, `offer_signup_id` int(11) DEFAULT NULL, `request_signup_id` int(11) DEFAULT NULL, `pinch_hitter_id` int(11) DEFAULT NULL, @@ -314,7 +324,7 @@ CREATE TABLE `challenge_claims` ( `id` int(11) NOT NULL AUTO_INCREMENT, `collection_id` int(11) DEFAULT NULL, `creation_id` int(11) DEFAULT NULL, - `creation_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `creation_type` varchar(255) DEFAULT NULL, `request_signup_id` int(11) DEFAULT NULL, `request_prompt_id` int(11) DEFAULT NULL, `claiming_user_id` int(11) DEFAULT NULL, @@ -339,8 +349,8 @@ CREATE TABLE `challenge_signups` ( `pseud_id` int(11) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `assigned_as_request` tinyint(1) DEFAULT '0', - `assigned_as_offer` tinyint(1) DEFAULT '0', + `assigned_as_request` tinyint(1) DEFAULT 0, + `assigned_as_offer` tinyint(1) DEFAULT 0, PRIMARY KEY (`id`), KEY `signups_on_pseud_id` (`pseud_id`), KEY `index_challenge_signups_on_collection_id` (`collection_id`) @@ -352,26 +362,26 @@ DROP TABLE IF EXISTS `chapters`; CREATE TABLE `chapters` ( `id` int(11) NOT NULL AUTO_INCREMENT, `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `position` int(11) DEFAULT '1', + `position` int(11) DEFAULT 1, `work_id` int(11) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `posted` tinyint(1) NOT NULL DEFAULT '0', + `posted` tinyint(1) NOT NULL DEFAULT 0, `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `summary` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `summary` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `word_count` int(11) DEFAULT NULL, - `hidden_by_admin` tinyint(1) NOT NULL DEFAULT '0', + `hidden_by_admin` tinyint(1) NOT NULL DEFAULT 0, `published_at` date DEFAULT NULL, - `endnotes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `content_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `notes_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `endnotes_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', + `endnotes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `content_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `notes_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `endnotes_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `works_chapter_index` (`work_id`), KEY `index_chapters_on_work_id` (`work_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `collection_items`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -380,13 +390,13 @@ CREATE TABLE `collection_items` ( `id` int(11) NOT NULL AUTO_INCREMENT, `collection_id` int(11) DEFAULT NULL, `item_id` int(11) DEFAULT NULL, - `item_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'Work', - `user_approval_status` tinyint(4) NOT NULL DEFAULT '0', - `collection_approval_status` tinyint(4) NOT NULL DEFAULT '0', + `item_type` varchar(255) DEFAULT 'Work', + `user_approval_status` tinyint(4) NOT NULL DEFAULT 0, + `collection_approval_status` tinyint(4) NOT NULL DEFAULT 0, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `anonymous` tinyint(1) NOT NULL DEFAULT '0', - `unrevealed` tinyint(1) NOT NULL DEFAULT '0', + `anonymous` tinyint(1) NOT NULL DEFAULT 0, + `unrevealed` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `by collection and item` (`collection_id`,`item_id`,`item_type`), KEY `index_collection_items_approval_status` (`collection_id`,`user_approval_status`,`collection_approval_status`), @@ -402,7 +412,7 @@ CREATE TABLE `collection_participants` ( `id` int(11) NOT NULL AUTO_INCREMENT, `collection_id` int(11) DEFAULT NULL, `pseud_id` int(11) DEFAULT NULL, - `participant_role` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'None', + `participant_role` varchar(255) NOT NULL DEFAULT 'None', `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), @@ -419,14 +429,14 @@ CREATE TABLE `collection_preferences` ( `collection_id` int(11) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `moderated` tinyint(1) NOT NULL DEFAULT '0', - `closed` tinyint(1) NOT NULL DEFAULT '0', - `unrevealed` tinyint(1) NOT NULL DEFAULT '0', - `anonymous` tinyint(1) NOT NULL DEFAULT '0', - `gift_exchange` tinyint(1) NOT NULL DEFAULT '0', - `show_random` tinyint(1) NOT NULL DEFAULT '0', - `prompt_meme` tinyint(1) NOT NULL DEFAULT '0', - `email_notify` tinyint(1) NOT NULL DEFAULT '0', + `moderated` tinyint(1) NOT NULL DEFAULT 0, + `closed` tinyint(1) NOT NULL DEFAULT 0, + `unrevealed` tinyint(1) NOT NULL DEFAULT 0, + `anonymous` tinyint(1) NOT NULL DEFAULT 0, + `gift_exchange` tinyint(1) NOT NULL DEFAULT 0, + `show_random` tinyint(1) NOT NULL DEFAULT 0, + `prompt_meme` tinyint(1) NOT NULL DEFAULT 0, + `email_notify` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `index_collection_preferences_on_collection_id` (`collection_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; @@ -437,16 +447,16 @@ DROP TABLE IF EXISTS `collection_profiles`; CREATE TABLE `collection_profiles` ( `id` int(11) NOT NULL AUTO_INCREMENT, `collection_id` int(11) DEFAULT NULL, - `intro` mediumtext COLLATE utf8mb4_unicode_ci, - `faq` mediumtext COLLATE utf8mb4_unicode_ci, - `rules` mediumtext COLLATE utf8mb4_unicode_ci, + `intro` mediumtext DEFAULT NULL, + `faq` mediumtext DEFAULT NULL, + `rules` mediumtext DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `gift_notification` text COLLATE utf8mb4_unicode_ci, - `intro_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `faq_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `rules_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `assignment_notification` text COLLATE utf8mb4_unicode_ci, + `gift_notification` text DEFAULT NULL, + `intro_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `faq_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `rules_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `assignment_notification` text DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_collection_profiles_on_collection_id` (`collection_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; @@ -456,23 +466,23 @@ DROP TABLE IF EXISTS `collections`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `collections` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `header_image_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `description` text COLLATE utf8mb4_unicode_ci, + `name` varchar(255) DEFAULT NULL, + `title` varchar(255) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `header_image_url` varchar(255) DEFAULT NULL, + `description` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `parent_id` int(11) DEFAULT NULL, `challenge_id` int(11) DEFAULT NULL, - `challenge_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `icon_file_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `icon_content_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `challenge_type` varchar(255) DEFAULT NULL, + `icon_file_name` varchar(255) DEFAULT NULL, + `icon_content_type` varchar(255) DEFAULT NULL, `icon_file_size` int(11) DEFAULT NULL, `icon_updated_at` datetime DEFAULT NULL, - `description_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `icon_alt_text` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '', - `icon_comment_text` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '', + `description_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `icon_alt_text` varchar(255) DEFAULT '', + `icon_comment_text` varchar(255) DEFAULT '', `multifandom` tinyint(1) DEFAULT NULL, `open_doors` tinyint(1) DEFAULT NULL, PRIMARY KEY (`id`), @@ -486,34 +496,35 @@ DROP TABLE IF EXISTS `comments`; CREATE TABLE `comments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `pseud_id` int(11) DEFAULT NULL, - `comment_content` text COLLATE utf8mb4_unicode_ci NOT NULL, + `comment_content` text NOT NULL, `depth` int(11) DEFAULT NULL, `threaded_left` int(11) DEFAULT NULL, `threaded_right` int(11) DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `ip_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `name` varchar(255) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `ip_address` varchar(255) DEFAULT NULL, `commentable_id` int(11) DEFAULT NULL, - `commentable_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `commentable_type` varchar(255) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `thread` int(11) DEFAULT NULL, - `user_agent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `approved` tinyint(1) NOT NULL DEFAULT '0', - `hidden_by_admin` tinyint(1) NOT NULL DEFAULT '0', + `user_agent` varchar(255) DEFAULT NULL, + `approved` tinyint(1) NOT NULL DEFAULT 0, + `hidden_by_admin` tinyint(1) NOT NULL DEFAULT 0, `edited_at` datetime DEFAULT NULL, `parent_id` int(11) DEFAULT NULL, - `parent_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `comment_content_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `unreviewed` tinyint(1) NOT NULL DEFAULT '0', - `iced` tinyint(1) NOT NULL DEFAULT '0', + `parent_type` varchar(255) DEFAULT NULL, + `comment_content_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `unreviewed` tinyint(1) NOT NULL DEFAULT 0, + `iced` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `index_comments_commentable` (`commentable_id`,`commentable_type`), KEY `index_comments_on_pseud_id` (`pseud_id`), KEY `index_comments_parent` (`parent_id`,`parent_type`), KEY `comments_by_thread` (`thread`), - KEY `index_comments_on_ip_address` (`ip_address`) + KEY `index_comments_on_ip_address` (`ip_address`), + KEY `index_comments_on_email` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `common_taggings`; @@ -523,7 +534,7 @@ CREATE TABLE `common_taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, `common_tag_id` int(11) NOT NULL, `filterable_id` int(11) NOT NULL, - `filterable_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `filterable_type` varchar(100) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), @@ -537,11 +548,11 @@ DROP TABLE IF EXISTS `creatorships`; CREATE TABLE `creatorships` ( `id` int(11) NOT NULL AUTO_INCREMENT, `creation_id` int(11) DEFAULT NULL, - `creation_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `creation_type` varchar(100) DEFAULT NULL, `pseud_id` int(11) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `approved` tinyint(1) NOT NULL DEFAULT '0', + `approved` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `creation_id_creation_type_pseud_id` (`creation_id`,`creation_type`,`pseud_id`), KEY `index_creatorships_pseud` (`pseud_id`) @@ -552,14 +563,14 @@ DROP TABLE IF EXISTS `delayed_jobs`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `delayed_jobs` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `priority` int(11) DEFAULT '0', - `attempts` int(11) DEFAULT '0', - `handler` text COLLATE utf8mb4_unicode_ci, - `last_error` text COLLATE utf8mb4_unicode_ci, + `priority` int(11) DEFAULT 0, + `attempts` int(11) DEFAULT 0, + `handler` text DEFAULT NULL, + `last_error` text DEFAULT NULL, `run_at` datetime DEFAULT NULL, `locked_at` datetime DEFAULT NULL, `failed_at` datetime DEFAULT NULL, - `locked_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `locked_by` varchar(255) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), @@ -575,7 +586,7 @@ DROP TABLE IF EXISTS `external_author_names`; CREATE TABLE `external_author_names` ( `id` int(11) NOT NULL AUTO_INCREMENT, `external_author_id` int(11) NOT NULL, - `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), @@ -587,11 +598,11 @@ DROP TABLE IF EXISTS `external_authors`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `external_authors` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_claimed` tinyint(1) NOT NULL DEFAULT '0', + `email` varchar(255) DEFAULT NULL, + `is_claimed` tinyint(1) NOT NULL DEFAULT 0, `user_id` int(11) DEFAULT NULL, - `do_not_email` tinyint(1) NOT NULL DEFAULT '0', - `do_not_import` tinyint(1) NOT NULL DEFAULT '0', + `do_not_email` tinyint(1) NOT NULL DEFAULT 0, + `do_not_import` tinyint(1) NOT NULL DEFAULT 0, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), @@ -605,7 +616,7 @@ DROP TABLE IF EXISTS `external_creatorships`; CREATE TABLE `external_creatorships` ( `id` int(11) NOT NULL AUTO_INCREMENT, `creation_id` int(11) DEFAULT NULL, - `creation_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `creation_type` varchar(255) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `archivist_id` int(11) DEFAULT NULL, @@ -621,15 +632,15 @@ DROP TABLE IF EXISTS `external_works`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `external_works` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `url` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `author` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `dead` tinyint(1) NOT NULL DEFAULT '0', + `url` varchar(255) NOT NULL, + `author` varchar(255) NOT NULL, + `dead` tinyint(1) NOT NULL DEFAULT 0, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `summary` text COLLATE utf8mb4_unicode_ci, - `hidden_by_admin` tinyint(1) NOT NULL DEFAULT '0', - `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', + `title` varchar(255) NOT NULL, + `summary` text DEFAULT NULL, + `hidden_by_admin` tinyint(1) NOT NULL DEFAULT 0, + `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, `language_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; @@ -641,7 +652,7 @@ CREATE TABLE `fannish_next_of_kins` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) DEFAULT NULL, `kin_id` int(11) DEFAULT NULL, - `kin_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `kin_email` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_fannish_next_of_kins_on_user_id` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; @@ -662,19 +673,18 @@ DROP TABLE IF EXISTS `feedbacks`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `feedbacks` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `comment` text COLLATE utf8mb4_unicode_ci NOT NULL, + `comment` text NOT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `summary` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `user_agent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `category` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `comment_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `ip_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `language` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `rollout` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `summary` varchar(255) DEFAULT NULL, + `user_agent` varchar(255) DEFAULT NULL, + `category` varchar(255) DEFAULT NULL, + `comment_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `username` varchar(255) DEFAULT NULL, + `language` varchar(255) DEFAULT NULL, + `rollout` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; @@ -684,8 +694,8 @@ DROP TABLE IF EXISTS `filter_counts`; CREATE TABLE `filter_counts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `filter_id` bigint(20) NOT NULL, - `public_works_count` bigint(20) DEFAULT '0', - `unhidden_works_count` bigint(20) DEFAULT '0', + `public_works_count` bigint(20) DEFAULT 0, + `unhidden_works_count` bigint(20) DEFAULT 0, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), @@ -701,10 +711,10 @@ CREATE TABLE `filter_taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, `filter_id` bigint(20) NOT NULL, `filterable_id` bigint(20) NOT NULL, - `filterable_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `filterable_type` varchar(100) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `inherited` tinyint(1) NOT NULL DEFAULT '0', + `inherited` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `index_filter_taggings_on_filter_and_filterable` (`filter_id`,`filterable_type`,`filterable_id`), KEY `index_filter_taggings_filterable` (`filterable_id`,`filterable_type`) @@ -717,33 +727,32 @@ CREATE TABLE `gift_exchanges` ( `id` int(11) NOT NULL AUTO_INCREMENT, `request_restriction_id` int(11) DEFAULT NULL, `offer_restriction_id` int(11) DEFAULT NULL, - `requests_num_required` int(11) NOT NULL DEFAULT '1', - `offers_num_required` int(11) NOT NULL DEFAULT '1', - `requests_num_allowed` int(11) NOT NULL DEFAULT '1', - `offers_num_allowed` int(11) NOT NULL DEFAULT '1', + `requests_num_required` int(11) NOT NULL DEFAULT 1, + `offers_num_required` int(11) NOT NULL DEFAULT 1, + `requests_num_allowed` int(11) NOT NULL DEFAULT 1, + `offers_num_allowed` int(11) NOT NULL DEFAULT 1, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `signup_instructions_general` text COLLATE utf8mb4_unicode_ci, - `signup_instructions_requests` text COLLATE utf8mb4_unicode_ci, - `signup_instructions_offers` text COLLATE utf8mb4_unicode_ci, - `signup_open` tinyint(1) NOT NULL DEFAULT '0', + `signup_instructions_general` text DEFAULT NULL, + `signup_instructions_requests` text DEFAULT NULL, + `signup_instructions_offers` text DEFAULT NULL, + `signup_open` tinyint(1) NOT NULL DEFAULT 0, `signups_open_at` datetime DEFAULT NULL, `signups_close_at` datetime DEFAULT NULL, `assignments_due_at` datetime DEFAULT NULL, `works_reveal_at` datetime DEFAULT NULL, `authors_reveal_at` datetime DEFAULT NULL, - `prompt_restriction_id` int(11) DEFAULT NULL, - `request_url_label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `request_description_label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `offer_url_label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `offer_description_label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `time_zone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `request_url_label` varchar(255) DEFAULT NULL, + `request_description_label` varchar(255) DEFAULT NULL, + `offer_url_label` varchar(255) DEFAULT NULL, + `offer_description_label` varchar(255) DEFAULT NULL, + `time_zone` varchar(255) DEFAULT NULL, `potential_match_settings_id` int(11) DEFAULT NULL, `assignments_sent_at` datetime DEFAULT NULL, - `signup_instructions_general_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `signup_instructions_requests_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `signup_instructions_offers_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `requests_summary_visible` tinyint(1) NOT NULL DEFAULT '0', + `signup_instructions_general_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `signup_instructions_requests_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `signup_instructions_offers_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `requests_summary_visible` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; @@ -753,11 +762,11 @@ DROP TABLE IF EXISTS `gifts`; CREATE TABLE `gifts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `work_id` int(11) DEFAULT NULL, - `recipient_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `recipient_name` varchar(255) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `pseud_id` int(11) DEFAULT NULL, - `rejected` tinyint(1) NOT NULL DEFAULT '0', + `rejected` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `index_gifts_on_recipient_name` (`recipient_name`), KEY `index_gifts_on_work_id` (`work_id`), @@ -773,8 +782,8 @@ CREATE TABLE `inbox_comments` ( `feedback_comment_id` int(11) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `read` tinyint(1) NOT NULL DEFAULT '0', - `replied_to` tinyint(1) NOT NULL DEFAULT '0', + `read` tinyint(1) NOT NULL DEFAULT 0, + `replied_to` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `index_inbox_comments_on_read_and_user_id` (`read`,`user_id`), KEY `index_inbox_comments_on_feedback_comment_id` (`feedback_comment_id`), @@ -786,7 +795,7 @@ DROP TABLE IF EXISTS `innodb_monitor`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `innodb_monitor` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -794,17 +803,17 @@ DROP TABLE IF EXISTS `invitations`; CREATE TABLE `invitations` ( `id` int(11) NOT NULL AUTO_INCREMENT, `creator_id` int(11) DEFAULT NULL, - `invitee_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `token` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `invitee_email` varchar(255) DEFAULT NULL, + `token` varchar(255) DEFAULT NULL, `sent_at` datetime DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `used` tinyint(1) NOT NULL DEFAULT '0', + `used` tinyint(1) NOT NULL DEFAULT 0, `invitee_id` int(11) DEFAULT NULL, - `invitee_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `creator_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `invitee_type` varchar(255) DEFAULT NULL, + `creator_type` varchar(255) DEFAULT NULL, `redeemed_at` datetime DEFAULT NULL, - `from_queue` tinyint(1) NOT NULL DEFAULT '0', + `from_queue` tinyint(1) NOT NULL DEFAULT 0, `external_author_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_invitations_on_invitee_id_and_invitee_type` (`invitee_id`,`invitee_type`), @@ -818,12 +827,11 @@ DROP TABLE IF EXISTS `invite_requests`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `invite_requests` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `position` int(11) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `simplified_email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', - `ip_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `simplified_email` varchar(255) NOT NULL DEFAULT '', + `ip_address` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `index_invite_requests_on_simplified_email` (`simplified_email`), KEY `index_invite_requests_on_email` (`email`) @@ -835,11 +843,11 @@ DROP TABLE IF EXISTS `known_issues`; CREATE TABLE `known_issues` ( `id` int(11) NOT NULL AUTO_INCREMENT, `admin_id` int(11) DEFAULT NULL, - `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `content` text COLLATE utf8mb4_unicode_ci, + `title` varchar(255) DEFAULT NULL, + `content` text DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `created_at` datetime DEFAULT NULL, - `content_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', + `content_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; @@ -849,10 +857,10 @@ DROP TABLE IF EXISTS `kudos`; CREATE TABLE `kudos` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `commentable_id` int(11) DEFAULT NULL, - `commentable_type` varchar(255) CHARACTER SET utf8 DEFAULT NULL, + `commentable_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `ip_address` varchar(255) CHARACTER SET utf8 DEFAULT NULL, + `ip_address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL, `user_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `index_kudos_on_commentable_and_user` (`commentable_id`,`commentable_type`,`user_id`), @@ -866,29 +874,41 @@ DROP TABLE IF EXISTS `languages`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `languages` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `short` varchar(4) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `support_available` tinyint(1) NOT NULL DEFAULT '0', - `abuse_support_available` tinyint(1) NOT NULL DEFAULT '0', - `sortable_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', + `short` varchar(4) DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `support_available` tinyint(1) NOT NULL DEFAULT 0, + `abuse_support_available` tinyint(1) NOT NULL DEFAULT 0, + `sortable_name` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `index_languages_on_short` (`short`), KEY `index_languages_on_sortable_name` (`sortable_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `last_wrangling_activities`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `last_wrangling_activities` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `user_id` bigint(20) NOT NULL, + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `index_last_wrangling_activities_on_user_id` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `locales`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `locales` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `iso` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `short` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `iso` varchar(255) DEFAULT NULL, + `short` varchar(255) DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, `main` tinyint(1) DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `language_id` int(11) NOT NULL, - `interface_enabled` tinyint(1) NOT NULL DEFAULT '0', - `email_enabled` tinyint(1) NOT NULL DEFAULT '0', + `interface_enabled` tinyint(1) NOT NULL DEFAULT 0, + `email_enabled` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `index_locales_on_iso` (`iso`), KEY `index_locales_on_short` (`short`), @@ -904,11 +924,12 @@ CREATE TABLE `log_items` ( `admin_id` int(11) DEFAULT NULL, `role_id` int(11) DEFAULT NULL, `action` tinyint(4) DEFAULT NULL, - `note` text COLLATE utf8mb4_unicode_ci NOT NULL, + `note` text NOT NULL, `enddate` datetime DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `note_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', + `note_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `fnok_user_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_log_items_on_user_id` (`user_id`), KEY `index_log_items_on_admin_id` (`admin_id`), @@ -922,7 +943,7 @@ CREATE TABLE `meta_taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, `meta_tag_id` bigint(20) NOT NULL, `sub_tag_id` bigint(20) NOT NULL, - `direct` tinyint(1) DEFAULT '1', + `direct` tinyint(1) DEFAULT 1, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), @@ -936,38 +957,28 @@ DROP TABLE IF EXISTS `moderated_works`; CREATE TABLE `moderated_works` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `work_id` bigint(20) NOT NULL, - `approved` tinyint(1) NOT NULL DEFAULT '0', - `reviewed` tinyint(1) NOT NULL DEFAULT '0', + `approved` tinyint(1) NOT NULL DEFAULT 0, + `reviewed` tinyint(1) NOT NULL DEFAULT 0, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`), KEY `index_moderated_works_on_work_id` (`work_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `open_id_authentication_associations`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `open_id_authentication_associations` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `issued` int(11) DEFAULT NULL, - `lifetime` int(11) DEFAULT NULL, - `handle` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `assoc_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `server_url` blob, - `secret` blob, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `open_id_authentication_nonces`; +DROP TABLE IF EXISTS `mutes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `open_id_authentication_nonces` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `timestamp` int(11) NOT NULL, - `server_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `salt` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE `mutes` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `muter_id` bigint(20) DEFAULT NULL, + `muted_id` bigint(20) DEFAULT NULL, + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `index_mutes_on_muter_id_and_muted_id` (`muter_id`,`muted_id`), + KEY `index_mutes_on_muter_id` (`muter_id`), + KEY `index_mutes_on_muted_id` (`muted_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `owned_set_taggings`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -976,7 +987,7 @@ CREATE TABLE `owned_set_taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, `owned_tag_set_id` int(11) DEFAULT NULL, `set_taggable_id` int(11) DEFAULT NULL, - `set_taggable_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `set_taggable_type` varchar(100) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) @@ -988,19 +999,19 @@ DROP TABLE IF EXISTS `owned_tag_sets`; CREATE TABLE `owned_tag_sets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tag_set_id` int(11) DEFAULT NULL, - `visible` tinyint(1) NOT NULL DEFAULT '0', - `nominated` tinyint(1) NOT NULL DEFAULT '0', - `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_at` datetime DEFAULT NULL, - `updated_at` datetime DEFAULT NULL, - `featured` tinyint(1) NOT NULL DEFAULT '0', - `description_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `fandom_nomination_limit` int(11) NOT NULL DEFAULT '0', - `character_nomination_limit` int(11) NOT NULL DEFAULT '0', - `relationship_nomination_limit` int(11) NOT NULL DEFAULT '0', - `freeform_nomination_limit` int(11) NOT NULL DEFAULT '0', - `usable` tinyint(1) NOT NULL DEFAULT '0', + `visible` tinyint(1) NOT NULL DEFAULT 0, + `nominated` tinyint(1) NOT NULL DEFAULT 0, + `title` varchar(255) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `created_at` datetime DEFAULT NULL, + `updated_at` datetime DEFAULT NULL, + `featured` tinyint(1) NOT NULL DEFAULT 0, + `description_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `fandom_nomination_limit` int(11) NOT NULL DEFAULT 0, + `character_nomination_limit` int(11) NOT NULL DEFAULT 0, + `relationship_nomination_limit` int(11) NOT NULL DEFAULT 0, + `freeform_nomination_limit` int(11) NOT NULL DEFAULT 0, + `usable` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; @@ -1009,21 +1020,21 @@ DROP TABLE IF EXISTS `potential_match_settings`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `potential_match_settings` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `num_required_prompts` int(11) NOT NULL DEFAULT '1', - `num_required_fandoms` int(11) NOT NULL DEFAULT '0', - `num_required_characters` int(11) NOT NULL DEFAULT '0', - `num_required_relationships` int(11) NOT NULL DEFAULT '0', - `num_required_freeforms` int(11) NOT NULL DEFAULT '0', - `num_required_categories` int(11) NOT NULL DEFAULT '0', - `num_required_ratings` int(11) NOT NULL DEFAULT '0', - `num_required_archive_warnings` int(11) NOT NULL DEFAULT '0', - `include_optional_fandoms` tinyint(1) NOT NULL DEFAULT '0', - `include_optional_characters` tinyint(1) NOT NULL DEFAULT '0', - `include_optional_relationships` tinyint(1) NOT NULL DEFAULT '0', - `include_optional_freeforms` tinyint(1) NOT NULL DEFAULT '0', - `include_optional_categories` tinyint(1) NOT NULL DEFAULT '0', - `include_optional_ratings` tinyint(1) NOT NULL DEFAULT '0', - `include_optional_archive_warnings` tinyint(1) NOT NULL DEFAULT '0', + `num_required_prompts` int(11) NOT NULL DEFAULT 1, + `num_required_fandoms` int(11) NOT NULL DEFAULT 0, + `num_required_characters` int(11) NOT NULL DEFAULT 0, + `num_required_relationships` int(11) NOT NULL DEFAULT 0, + `num_required_freeforms` int(11) NOT NULL DEFAULT 0, + `num_required_categories` int(11) NOT NULL DEFAULT 0, + `num_required_ratings` int(11) NOT NULL DEFAULT 0, + `num_required_archive_warnings` int(11) NOT NULL DEFAULT 0, + `include_optional_fandoms` tinyint(1) NOT NULL DEFAULT 0, + `include_optional_characters` tinyint(1) NOT NULL DEFAULT 0, + `include_optional_relationships` tinyint(1) NOT NULL DEFAULT 0, + `include_optional_freeforms` tinyint(1) NOT NULL DEFAULT 0, + `include_optional_categories` tinyint(1) NOT NULL DEFAULT 0, + `include_optional_ratings` tinyint(1) NOT NULL DEFAULT 0, + `include_optional_archive_warnings` tinyint(1) NOT NULL DEFAULT 0, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) @@ -1038,7 +1049,7 @@ CREATE TABLE `potential_matches` ( `offer_signup_id` int(11) DEFAULT NULL, `request_signup_id` int(11) DEFAULT NULL, `num_prompts_matched` int(11) DEFAULT NULL, - `assigned` tinyint(1) NOT NULL DEFAULT '0', + `assigned` tinyint(1) NOT NULL DEFAULT 0, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `max_tags_matched` int(11) DEFAULT NULL, @@ -1054,35 +1065,37 @@ DROP TABLE IF EXISTS `preferences`; CREATE TABLE `preferences` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) DEFAULT NULL, - `history_enabled` tinyint(1) DEFAULT '1', - `email_visible` tinyint(1) DEFAULT '0', - `created_at` datetime DEFAULT NULL, - `updated_at` datetime DEFAULT NULL, - `date_of_birth_visible` tinyint(1) DEFAULT '0', - `edit_emails_off` tinyint(1) NOT NULL DEFAULT '0', - `comment_emails_off` tinyint(1) NOT NULL DEFAULT '0', - `adult` tinyint(1) DEFAULT '0', - `hide_warnings` tinyint(1) NOT NULL DEFAULT '0', - `comment_inbox_off` tinyint(1) DEFAULT '0', - `comment_copy_to_self_off` tinyint(1) NOT NULL DEFAULT '1', - `work_title_format` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'TITLE - AUTHOR - FANDOM', - `hide_freeform` tinyint(1) NOT NULL DEFAULT '0', - `first_login` tinyint(1) DEFAULT '1', - `automatically_approve_collections` tinyint(1) NOT NULL DEFAULT '0', - `collection_emails_off` tinyint(1) NOT NULL DEFAULT '0', - `collection_inbox_off` tinyint(1) NOT NULL DEFAULT '0', - `recipient_emails_off` tinyint(1) NOT NULL DEFAULT '0', - `view_full_works` tinyint(1) NOT NULL DEFAULT '0', - `time_zone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `plain_text_skin` tinyint(1) NOT NULL DEFAULT '0', - `disable_work_skins` tinyint(1) NOT NULL DEFAULT '0', + `history_enabled` tinyint(1) DEFAULT 1, + `email_visible` tinyint(1) DEFAULT 0, + `created_at` datetime DEFAULT NULL, + `updated_at` datetime DEFAULT NULL, + `date_of_birth_visible` tinyint(1) DEFAULT 0, + `edit_emails_off` tinyint(1) NOT NULL DEFAULT 0, + `comment_emails_off` tinyint(1) NOT NULL DEFAULT 0, + `adult` tinyint(1) DEFAULT 0, + `hide_warnings` tinyint(1) NOT NULL DEFAULT 0, + `comment_inbox_off` tinyint(1) DEFAULT 0, + `comment_copy_to_self_off` tinyint(1) NOT NULL DEFAULT 1, + `work_title_format` varchar(255) DEFAULT 'TITLE - AUTHOR - FANDOM', + `hide_freeform` tinyint(1) NOT NULL DEFAULT 0, + `first_login` tinyint(1) DEFAULT 1, + `collection_emails_off` tinyint(1) NOT NULL DEFAULT 0, + `collection_inbox_off` tinyint(1) NOT NULL DEFAULT 0, + `recipient_emails_off` tinyint(1) NOT NULL DEFAULT 0, + `view_full_works` tinyint(1) NOT NULL DEFAULT 0, + `time_zone` varchar(255) DEFAULT NULL, + `plain_text_skin` tinyint(1) NOT NULL DEFAULT 0, + `disable_work_skins` tinyint(1) NOT NULL DEFAULT 0, `skin_id` int(11) DEFAULT NULL, - `minimize_search_engines` tinyint(1) NOT NULL DEFAULT '0', - `kudos_emails_off` tinyint(1) NOT NULL DEFAULT '0', - `disable_share_links` tinyint(1) NOT NULL DEFAULT '0', - `banner_seen` tinyint(1) NOT NULL DEFAULT '0', - `preferred_locale` int(11) NOT NULL DEFAULT '1', - `allow_cocreator` tinyint(1) DEFAULT '0', + `minimize_search_engines` tinyint(1) NOT NULL DEFAULT 0, + `kudos_emails_off` tinyint(1) NOT NULL DEFAULT 0, + `disable_share_links` tinyint(1) NOT NULL DEFAULT 0, + `banner_seen` tinyint(1) NOT NULL DEFAULT 0, + `preferred_locale` int(11) NOT NULL DEFAULT 1, + `allow_cocreator` tinyint(1) DEFAULT 0, + `allow_gifts` tinyint(1) NOT NULL DEFAULT 0, + `allow_collection_invitation` tinyint(1) NOT NULL DEFAULT 0, + `guest_replies_off` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `index_preferences_on_user_id` (`user_id`), KEY `index_preferences_on_skin_id` (`skin_id`) @@ -1094,13 +1107,13 @@ DROP TABLE IF EXISTS `profiles`; CREATE TABLE `profiles` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) DEFAULT NULL, - `location` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `about_me` text COLLATE utf8mb4_unicode_ci, + `location` varchar(255) DEFAULT NULL, + `about_me` text DEFAULT NULL, `date_of_birth` date DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `about_me_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', + `title` varchar(255) DEFAULT NULL, + `about_me_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `index_profiles_on_user_id` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; @@ -1110,26 +1123,25 @@ DROP TABLE IF EXISTS `prompt_memes`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `prompt_memes` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `prompt_restriction_id` int(11) DEFAULT NULL, `request_restriction_id` int(11) DEFAULT NULL, - `requests_num_required` int(11) NOT NULL DEFAULT '1', - `requests_num_allowed` int(11) NOT NULL DEFAULT '5', - `signup_open` tinyint(1) NOT NULL DEFAULT '1', + `requests_num_required` int(11) NOT NULL DEFAULT 1, + `requests_num_allowed` int(11) NOT NULL DEFAULT 5, + `signup_open` tinyint(1) NOT NULL DEFAULT 1, `signups_open_at` datetime DEFAULT NULL, `signups_close_at` datetime DEFAULT NULL, `assignments_due_at` datetime DEFAULT NULL, `works_reveal_at` datetime DEFAULT NULL, `authors_reveal_at` datetime DEFAULT NULL, - `signup_instructions_general` text COLLATE utf8mb4_unicode_ci, - `signup_instructions_requests` text COLLATE utf8mb4_unicode_ci, - `request_url_label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `request_description_label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `time_zone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `signup_instructions_general_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `signup_instructions_requests_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', + `signup_instructions_general` text DEFAULT NULL, + `signup_instructions_requests` text DEFAULT NULL, + `request_url_label` varchar(255) DEFAULT NULL, + `request_description_label` varchar(255) DEFAULT NULL, + `time_zone` varchar(255) DEFAULT NULL, + `signup_instructions_general_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `signup_instructions_requests_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `anonymous` tinyint(1) NOT NULL DEFAULT '0', + `anonymous` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; @@ -1139,47 +1151,47 @@ DROP TABLE IF EXISTS `prompt_restrictions`; CREATE TABLE `prompt_restrictions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tag_set_id` int(11) DEFAULT NULL, - `optional_tags_allowed` tinyint(1) NOT NULL DEFAULT '0', - `description_allowed` tinyint(1) NOT NULL DEFAULT '1', - `url_required` tinyint(1) NOT NULL DEFAULT '0', - `fandom_num_required` int(11) NOT NULL DEFAULT '0', - `category_num_required` int(11) NOT NULL DEFAULT '0', - `rating_num_required` int(11) NOT NULL DEFAULT '0', - `character_num_required` int(11) NOT NULL DEFAULT '0', - `relationship_num_required` int(11) NOT NULL DEFAULT '0', - `freeform_num_required` int(11) NOT NULL DEFAULT '0', - `archive_warning_num_required` int(11) NOT NULL DEFAULT '0', - `fandom_num_allowed` int(11) NOT NULL DEFAULT '1', - `category_num_allowed` int(11) NOT NULL DEFAULT '0', - `rating_num_allowed` int(11) NOT NULL DEFAULT '0', - `character_num_allowed` int(11) NOT NULL DEFAULT '1', - `relationship_num_allowed` int(11) NOT NULL DEFAULT '1', - `freeform_num_allowed` int(11) NOT NULL DEFAULT '0', - `archive_warning_num_allowed` int(11) NOT NULL DEFAULT '0', - `created_at` datetime DEFAULT NULL, - `updated_at` datetime DEFAULT NULL, - `description_required` tinyint(1) NOT NULL DEFAULT '0', - `url_allowed` tinyint(1) NOT NULL DEFAULT '0', - `allow_any_fandom` tinyint(1) NOT NULL DEFAULT '0', - `allow_any_character` tinyint(1) NOT NULL DEFAULT '0', - `allow_any_rating` tinyint(1) NOT NULL DEFAULT '0', - `allow_any_relationship` tinyint(1) NOT NULL DEFAULT '0', - `allow_any_category` tinyint(1) NOT NULL DEFAULT '0', - `allow_any_archive_warning` tinyint(1) NOT NULL DEFAULT '0', - `allow_any_freeform` tinyint(1) NOT NULL DEFAULT '0', - `require_unique_fandom` tinyint(1) NOT NULL DEFAULT '0', - `require_unique_character` tinyint(1) NOT NULL DEFAULT '0', - `require_unique_rating` tinyint(1) NOT NULL DEFAULT '0', - `require_unique_relationship` tinyint(1) NOT NULL DEFAULT '0', - `require_unique_category` tinyint(1) NOT NULL DEFAULT '0', - `require_unique_archive_warning` tinyint(1) NOT NULL DEFAULT '0', - `require_unique_freeform` tinyint(1) NOT NULL DEFAULT '0', - `character_restrict_to_fandom` tinyint(1) NOT NULL DEFAULT '0', - `relationship_restrict_to_fandom` tinyint(1) NOT NULL DEFAULT '0', - `character_restrict_to_tag_set` tinyint(1) NOT NULL DEFAULT '0', - `relationship_restrict_to_tag_set` tinyint(1) NOT NULL DEFAULT '0', - `title_required` tinyint(1) NOT NULL DEFAULT '0', - `title_allowed` tinyint(1) NOT NULL DEFAULT '0', + `optional_tags_allowed` tinyint(1) NOT NULL DEFAULT 0, + `description_allowed` tinyint(1) NOT NULL DEFAULT 1, + `url_required` tinyint(1) NOT NULL DEFAULT 0, + `fandom_num_required` int(11) NOT NULL DEFAULT 0, + `category_num_required` int(11) NOT NULL DEFAULT 0, + `rating_num_required` int(11) NOT NULL DEFAULT 0, + `character_num_required` int(11) NOT NULL DEFAULT 0, + `relationship_num_required` int(11) NOT NULL DEFAULT 0, + `freeform_num_required` int(11) NOT NULL DEFAULT 0, + `archive_warning_num_required` int(11) NOT NULL DEFAULT 0, + `fandom_num_allowed` int(11) NOT NULL DEFAULT 1, + `category_num_allowed` int(11) NOT NULL DEFAULT 0, + `rating_num_allowed` int(11) NOT NULL DEFAULT 0, + `character_num_allowed` int(11) NOT NULL DEFAULT 1, + `relationship_num_allowed` int(11) NOT NULL DEFAULT 1, + `freeform_num_allowed` int(11) NOT NULL DEFAULT 0, + `archive_warning_num_allowed` int(11) NOT NULL DEFAULT 0, + `created_at` datetime DEFAULT NULL, + `updated_at` datetime DEFAULT NULL, + `description_required` tinyint(1) NOT NULL DEFAULT 0, + `url_allowed` tinyint(1) NOT NULL DEFAULT 0, + `allow_any_fandom` tinyint(1) NOT NULL DEFAULT 0, + `allow_any_character` tinyint(1) NOT NULL DEFAULT 0, + `allow_any_rating` tinyint(1) NOT NULL DEFAULT 0, + `allow_any_relationship` tinyint(1) NOT NULL DEFAULT 0, + `allow_any_category` tinyint(1) NOT NULL DEFAULT 0, + `allow_any_archive_warning` tinyint(1) NOT NULL DEFAULT 0, + `allow_any_freeform` tinyint(1) NOT NULL DEFAULT 0, + `require_unique_fandom` tinyint(1) NOT NULL DEFAULT 0, + `require_unique_character` tinyint(1) NOT NULL DEFAULT 0, + `require_unique_rating` tinyint(1) NOT NULL DEFAULT 0, + `require_unique_relationship` tinyint(1) NOT NULL DEFAULT 0, + `require_unique_category` tinyint(1) NOT NULL DEFAULT 0, + `require_unique_archive_warning` tinyint(1) NOT NULL DEFAULT 0, + `require_unique_freeform` tinyint(1) NOT NULL DEFAULT 0, + `character_restrict_to_fandom` tinyint(1) NOT NULL DEFAULT 0, + `relationship_restrict_to_fandom` tinyint(1) NOT NULL DEFAULT 0, + `character_restrict_to_tag_set` tinyint(1) NOT NULL DEFAULT 0, + `relationship_restrict_to_tag_set` tinyint(1) NOT NULL DEFAULT 0, + `title_required` tinyint(1) NOT NULL DEFAULT 0, + `title_allowed` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; @@ -1193,22 +1205,22 @@ CREATE TABLE `prompts` ( `pseud_id` int(11) DEFAULT NULL, `tag_set_id` int(11) DEFAULT NULL, `optional_tag_set_id` int(11) DEFAULT NULL, - `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `description` text COLLATE utf8mb4_unicode_ci, + `title` varchar(255) DEFAULT NULL, + `url` varchar(255) DEFAULT NULL, + `description` text DEFAULT NULL, `position` int(11) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `description_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `any_fandom` tinyint(1) NOT NULL DEFAULT '0', - `any_character` tinyint(1) NOT NULL DEFAULT '0', - `any_rating` tinyint(1) NOT NULL DEFAULT '0', - `any_relationship` tinyint(1) NOT NULL DEFAULT '0', - `any_category` tinyint(1) NOT NULL DEFAULT '0', - `any_archive_warning` tinyint(1) NOT NULL DEFAULT '0', - `any_freeform` tinyint(1) NOT NULL DEFAULT '0', - `anonymous` tinyint(1) NOT NULL DEFAULT '0', + `type` varchar(255) DEFAULT NULL, + `description_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `any_fandom` tinyint(1) NOT NULL DEFAULT 0, + `any_character` tinyint(1) NOT NULL DEFAULT 0, + `any_rating` tinyint(1) NOT NULL DEFAULT 0, + `any_relationship` tinyint(1) NOT NULL DEFAULT 0, + `any_category` tinyint(1) NOT NULL DEFAULT 0, + `any_archive_warning` tinyint(1) NOT NULL DEFAULT 0, + `any_freeform` tinyint(1) NOT NULL DEFAULT 0, + `anonymous` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `index_prompts_on_tag_set_id` (`tag_set_id`), KEY `index_prompts_on_type` (`type`), @@ -1223,19 +1235,19 @@ DROP TABLE IF EXISTS `pseuds`; CREATE TABLE `pseuds` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) DEFAULT NULL, - `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `description` text COLLATE utf8mb4_unicode_ci, - `is_default` tinyint(1) NOT NULL DEFAULT '0', + `name` varchar(255) NOT NULL, + `description` text DEFAULT NULL, + `is_default` tinyint(1) NOT NULL DEFAULT 0, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `icon_file_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `icon_content_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `icon_file_name` varchar(255) DEFAULT NULL, + `icon_content_type` varchar(255) DEFAULT NULL, `icon_file_size` int(11) DEFAULT NULL, `icon_updated_at` datetime DEFAULT NULL, - `icon_alt_text` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '', - `delta` tinyint(1) DEFAULT '1', - `description_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `icon_comment_text` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '', + `icon_alt_text` varchar(255) DEFAULT '', + `delta` tinyint(1) DEFAULT 1, + `description_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `icon_comment_text` varchar(255) DEFAULT '', PRIMARY KEY (`id`), KEY `index_pseuds_on_user_id_and_name` (`user_id`,`name`), KEY `index_psueds_on_name` (`name`) @@ -1247,14 +1259,14 @@ DROP TABLE IF EXISTS `question_translations`; CREATE TABLE `question_translations` ( `id` int(11) NOT NULL AUTO_INCREMENT, `question_id` int(11) DEFAULT NULL, - `locale` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `locale` varchar(255) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, - `question` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `content` text COLLATE utf8mb4_unicode_ci, - `content_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `screencast_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `is_translated` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `question` varchar(255) DEFAULT NULL, + `content` text DEFAULT NULL, + `content_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `screencast_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `is_translated` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_question_translations_on_question_id` (`question_id`), KEY `index_question_translations_on_locale` (`locale`) @@ -1266,13 +1278,13 @@ DROP TABLE IF EXISTS `questions`; CREATE TABLE `questions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `archive_faq_id` int(11) DEFAULT NULL, - `question` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `content` text COLLATE utf8mb4_unicode_ci, - `anchor` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `screencast` text COLLATE utf8mb4_unicode_ci, + `question` varchar(255) DEFAULT NULL, + `content` text DEFAULT NULL, + `anchor` varchar(255) DEFAULT NULL, + `screencast` text DEFAULT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, - `position` int(11) DEFAULT '1', + `position` int(11) DEFAULT 1, PRIMARY KEY (`id`), KEY `index_questions_on_archive_faq_id_and_position` (`archive_faq_id`,`position`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; @@ -1288,9 +1300,9 @@ CREATE TABLE `readings` ( `work_id` int(11) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `last_viewed` datetime DEFAULT NULL, - `view_count` int(11) DEFAULT '0', - `toread` tinyint(1) NOT NULL DEFAULT '0', - `toskip` tinyint(1) NOT NULL DEFAULT '0', + `view_count` int(11) DEFAULT 0, + `toread` tinyint(1) NOT NULL DEFAULT 0, + `toskip` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `index_readings_on_work_id` (`work_id`), KEY `index_readings_on_user_id` (`user_id`) @@ -1302,12 +1314,12 @@ DROP TABLE IF EXISTS `related_works`; CREATE TABLE `related_works` ( `id` int(11) NOT NULL AUTO_INCREMENT, `parent_id` int(11) DEFAULT NULL, - `parent_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `parent_type` varchar(255) DEFAULT NULL, `work_id` int(11) DEFAULT NULL, - `reciprocal` tinyint(1) NOT NULL DEFAULT '0', + `reciprocal` tinyint(1) NOT NULL DEFAULT 0, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `translation` tinyint(1) NOT NULL DEFAULT '0', + `translation` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `index_related_works_on_parent_id_and_parent_type` (`parent_id`,`parent_type`), KEY `index_related_works_on_work_id` (`work_id`) @@ -1318,8 +1330,8 @@ DROP TABLE IF EXISTS `roles`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `roles` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `authorizable_type` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `name` varchar(40) DEFAULT NULL, + `authorizable_type` varchar(40) DEFAULT NULL, `authorizable_id` int(11) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, @@ -1337,15 +1349,18 @@ CREATE TABLE `roles_users` ( `role_id` int(11) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, + `id` bigint(20) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), KEY `index_roles_users_on_role_id_and_user_id` (`role_id`,`user_id`), KEY `index_roles_users_on_user_id_and_role_id` (`user_id`,`role_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `schema_migrations`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `schema_migrations` ( - `version` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `version` varchar(255) NOT NULL, + PRIMARY KEY (`version`), UNIQUE KEY `unique_schema_migrations` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; @@ -1355,9 +1370,9 @@ DROP TABLE IF EXISTS `searches`; CREATE TABLE `searches` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) DEFAULT NULL, - `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `options` text COLLATE utf8mb4_unicode_ci, - `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `options` text DEFAULT NULL, + `type` varchar(255) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) @@ -1370,7 +1385,7 @@ CREATE TABLE `serial_works` ( `id` int(11) NOT NULL AUTO_INCREMENT, `series_id` int(11) DEFAULT NULL, `work_id` int(11) DEFAULT NULL, - `position` int(11) DEFAULT '1', + `position` int(11) DEFAULT 1, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), @@ -1385,14 +1400,14 @@ CREATE TABLE `series` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `summary` text COLLATE utf8mb4_unicode_ci, - `series_notes` text COLLATE utf8mb4_unicode_ci, - `hidden_by_admin` tinyint(1) NOT NULL DEFAULT '0', - `restricted` tinyint(1) NOT NULL DEFAULT '1', - `complete` tinyint(1) NOT NULL DEFAULT '0', - `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `series_notes_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', + `title` varchar(255) NOT NULL, + `summary` text DEFAULT NULL, + `series_notes` text DEFAULT NULL, + `hidden_by_admin` tinyint(1) NOT NULL DEFAULT 0, + `restricted` tinyint(1) NOT NULL DEFAULT 1, + `complete` tinyint(1) NOT NULL DEFAULT 0, + `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `series_notes_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; @@ -1428,41 +1443,41 @@ DROP TABLE IF EXISTS `skins`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `skins` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `title` varchar(255) DEFAULT NULL, `author_id` int(11) DEFAULT NULL, - `css` text COLLATE utf8mb4_unicode_ci, - `public` tinyint(1) DEFAULT '0', - `official` tinyint(1) DEFAULT '0', + `css` text DEFAULT NULL, + `public` tinyint(1) DEFAULT 0, + `official` tinyint(1) DEFAULT 0, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `icon_file_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `icon_content_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `icon_file_name` varchar(255) DEFAULT NULL, + `icon_content_type` varchar(255) DEFAULT NULL, `icon_file_size` int(11) DEFAULT NULL, `icon_updated_at` datetime DEFAULT NULL, - `icon_alt_text` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '', + `icon_alt_text` varchar(255) DEFAULT '', `margin` int(11) DEFAULT NULL, `paragraph_gap` int(11) DEFAULT NULL, - `font` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `font` varchar(255) DEFAULT NULL, `base_em` int(11) DEFAULT NULL, - `background_color` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `foreground_color` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `description` text COLLATE utf8mb4_unicode_ci, - `rejected` tinyint(1) NOT NULL DEFAULT '0', - `admin_note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `description_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `background_color` varchar(255) DEFAULT NULL, + `foreground_color` varchar(255) DEFAULT NULL, + `description` text DEFAULT NULL, + `rejected` tinyint(1) NOT NULL DEFAULT 0, + `admin_note` varchar(255) DEFAULT NULL, + `description_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `type` varchar(255) DEFAULT NULL, `paragraph_margin` float DEFAULT NULL, - `headercolor` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `accent_color` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `role` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `media` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `ie_condition` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `filename` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `do_not_upgrade` tinyint(1) NOT NULL DEFAULT '0', - `cached` tinyint(1) NOT NULL DEFAULT '0', - `unusable` tinyint(1) NOT NULL DEFAULT '0', - `featured` tinyint(1) NOT NULL DEFAULT '0', - `in_chooser` tinyint(1) NOT NULL DEFAULT '0', + `headercolor` varchar(255) DEFAULT NULL, + `accent_color` varchar(255) DEFAULT NULL, + `role` varchar(255) DEFAULT NULL, + `media` varchar(255) DEFAULT NULL, + `ie_condition` varchar(255) DEFAULT NULL, + `filename` varchar(255) DEFAULT NULL, + `do_not_upgrade` tinyint(1) NOT NULL DEFAULT 0, + `cached` tinyint(1) NOT NULL DEFAULT 0, + `unusable` tinyint(1) NOT NULL DEFAULT 0, + `featured` tinyint(1) NOT NULL DEFAULT 0, + `in_chooser` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `index_skins_on_type` (`type`), KEY `index_skins_on_public_and_official` (`public`,`official`), @@ -1477,11 +1492,11 @@ DROP TABLE IF EXISTS `stat_counters`; CREATE TABLE `stat_counters` ( `id` int(11) NOT NULL AUTO_INCREMENT, `work_id` int(11) DEFAULT NULL, - `hit_count` int(11) NOT NULL DEFAULT '0', - `download_count` int(11) NOT NULL DEFAULT '0', - `comments_count` int(11) NOT NULL DEFAULT '0', - `kudos_count` int(11) NOT NULL DEFAULT '0', - `bookmarks_count` int(11) NOT NULL DEFAULT '0', + `hit_count` int(11) NOT NULL DEFAULT 0, + `download_count` int(11) NOT NULL DEFAULT 0, + `comments_count` int(11) NOT NULL DEFAULT 0, + `kudos_count` int(11) NOT NULL DEFAULT 0, + `bookmarks_count` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `index_hit_counters_on_work_id` (`work_id`), KEY `index_hit_counters_on_hit_count` (`hit_count`) @@ -1494,7 +1509,7 @@ CREATE TABLE `subscriptions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) DEFAULT NULL, `subscribable_id` int(11) DEFAULT NULL, - `subscribable_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `subscribable_type` varchar(255) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), @@ -1507,25 +1522,26 @@ DROP TABLE IF EXISTS `tag_nominations`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tag_nominations` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `type` varchar(255) DEFAULT NULL, `tag_set_nomination_id` int(11) DEFAULT NULL, `fandom_nomination_id` int(11) DEFAULT NULL, - `tagname` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `parent_tagname` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `approved` tinyint(1) NOT NULL DEFAULT '0', - `rejected` tinyint(1) NOT NULL DEFAULT '0', + `tagname` varchar(255) DEFAULT NULL, + `parent_tagname` varchar(255) DEFAULT NULL, + `approved` tinyint(1) NOT NULL DEFAULT 0, + `rejected` tinyint(1) NOT NULL DEFAULT 0, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `canonical` tinyint(1) NOT NULL DEFAULT '0', - `exists` tinyint(1) NOT NULL DEFAULT '0', - `parented` tinyint(1) NOT NULL DEFAULT '0', - `synonym` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `canonical` tinyint(1) NOT NULL DEFAULT 0, + `exists` tinyint(1) NOT NULL DEFAULT 0, + `parented` tinyint(1) NOT NULL DEFAULT 0, + `synonym` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_tag_nominations_on_tagname` (`tagname`), KEY `index_tag_nominations_on_type_and_tag_set_nomination_id` (`type`,`tag_set_nomination_id`), KEY `index_tag_nominations_on_type_and_fandom_nomination_id` (`type`,`fandom_nomination_id`), KEY `index_tag_nominations_on_type_and_synonym` (`type`,`synonym`), - KEY `index_tag_nominations_on_type_and_tagname` (`type`,`tagname`) + KEY `index_tag_nominations_on_type_and_tagname` (`type`,`tagname`), + KEY `index_tag_nominations_on_tag_set_nomination_id_and_type` (`tag_set_nomination_id`,`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `tag_set_associations`; @@ -1538,7 +1554,10 @@ CREATE TABLE `tag_set_associations` ( `parent_tag_id` int(11) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + UNIQUE KEY `index_tag_set_associations_on_tag_set_and_parent_and_tag` (`owned_tag_set_id`,`parent_tag_id`,`tag_id`), + KEY `index_tag_set_associations_on_tag_id` (`tag_id`), + KEY `index_tag_set_associations_on_parent_tag_id` (`parent_tag_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `tag_set_nominations`; @@ -1550,7 +1569,9 @@ CREATE TABLE `tag_set_nominations` ( `owned_tag_set_id` int(11) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + KEY `index_tag_set_nominations_on_owned_tag_set_id` (`owned_tag_set_id`), + KEY `index_tag_set_nominations_on_pseud_id_and_owned_tag_set_id` (`pseud_id`,`owned_tag_set_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `tag_set_ownerships`; @@ -1560,7 +1581,7 @@ CREATE TABLE `tag_set_ownerships` ( `id` int(11) NOT NULL AUTO_INCREMENT, `pseud_id` int(11) DEFAULT NULL, `owned_tag_set_id` int(11) DEFAULT NULL, - `owner` tinyint(1) NOT NULL DEFAULT '0', + `owner` tinyint(1) NOT NULL DEFAULT 0, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) @@ -1583,10 +1604,10 @@ CREATE TABLE `taggings` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tagger_id` int(11) DEFAULT NULL, `taggable_id` int(11) NOT NULL, - `taggable_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT '', + `taggable_type` varchar(100) DEFAULT '', `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `tagger_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT '', + `tagger_type` varchar(100) DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `index_taggings_polymorphic` (`tagger_id`,`tagger_type`,`taggable_id`,`taggable_type`), KEY `index_taggings_taggable` (`taggable_id`,`taggable_type`) @@ -1597,19 +1618,19 @@ DROP TABLE IF EXISTS `tags`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tags` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT '', - `canonical` tinyint(1) NOT NULL DEFAULT '0', + `name` varchar(100) DEFAULT '', + `canonical` tinyint(1) NOT NULL DEFAULT 0, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `taggings_count_cache` int(11) DEFAULT '0', - `adult` tinyint(1) DEFAULT '0', - `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `taggings_count_cache` int(11) DEFAULT 0, + `adult` tinyint(1) DEFAULT 0, + `type` varchar(255) DEFAULT NULL, `merger_id` int(11) DEFAULT NULL, - `delta` tinyint(1) DEFAULT '0', + `delta` tinyint(1) DEFAULT 0, `last_wrangler_id` int(11) DEFAULT NULL, - `last_wrangler_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `unwrangleable` tinyint(1) NOT NULL DEFAULT '0', - `sortable_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', + `last_wrangler_type` varchar(255) DEFAULT NULL, + `unwrangleable` tinyint(1) NOT NULL DEFAULT 0, + `sortable_name` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `index_tags_on_name` (`name`), KEY `index_tags_on_merger_id` (`merger_id`), @@ -1628,9 +1649,9 @@ CREATE TABLE `user_invite_requests` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) DEFAULT NULL, `quantity` int(11) DEFAULT NULL, - `reason` text COLLATE utf8mb4_unicode_ci, - `granted` tinyint(1) NOT NULL DEFAULT '0', - `handled` tinyint(1) NOT NULL DEFAULT '0', + `reason` text DEFAULT NULL, + `granted` tinyint(1) NOT NULL DEFAULT 0, + `handled` tinyint(1) NOT NULL DEFAULT 0, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), @@ -1644,37 +1665,40 @@ CREATE TABLE `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `confirmation_token` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `login` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `confirmation_token` varchar(255) DEFAULT NULL, + `login` varchar(255) DEFAULT NULL, `confirmed_at` datetime DEFAULT NULL, - `encrypted_password` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `password_salt` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `suspended` tinyint(1) NOT NULL DEFAULT '0', - `banned` tinyint(1) NOT NULL DEFAULT '0', + `encrypted_password` varchar(255) DEFAULT NULL, + `password_salt` varchar(255) DEFAULT NULL, + `suspended` tinyint(1) NOT NULL DEFAULT 0, + `banned` tinyint(1) NOT NULL DEFAULT 0, `invitation_id` int(11) DEFAULT NULL, `suspended_until` datetime DEFAULT NULL, - `out_of_invites` tinyint(1) NOT NULL DEFAULT '1', - `failed_attempts` int(11) DEFAULT '0', + `out_of_invites` tinyint(1) NOT NULL DEFAULT 1, + `failed_attempts` int(11) DEFAULT 0, `accepted_tos_version` int(11) DEFAULT NULL, `confirmation_sent_at` datetime DEFAULT NULL, - `reset_password_token` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `reset_password_token` varchar(255) DEFAULT NULL, `reset_password_sent_at` datetime DEFAULT NULL, `remember_created_at` datetime DEFAULT NULL, - `sign_in_count` int(11) DEFAULT '0', + `sign_in_count` int(11) DEFAULT 0, `current_sign_in_at` datetime DEFAULT NULL, `last_sign_in_at` datetime DEFAULT NULL, - `current_sign_in_ip` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_sign_in_ip` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `unlock_token` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `current_sign_in_ip` varchar(255) DEFAULT NULL, + `last_sign_in_ip` varchar(255) DEFAULT NULL, + `unlock_token` varchar(255) DEFAULT NULL, `locked_at` datetime DEFAULT NULL, `recently_reset` tinyint(1) DEFAULT NULL, + `renamed_at` datetime DEFAULT NULL, + `resets_requested` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `index_users_on_login` (`login`), UNIQUE KEY `index_users_on_reset_password_token` (`reset_password_token`), UNIQUE KEY `index_users_on_unlock_token` (`unlock_token`), UNIQUE KEY `index_users_on_confirmation_token` (`confirmation_token`), - UNIQUE KEY `index_users_on_email` (`email`) + UNIQUE KEY `index_users_on_email` (`email`), + KEY `index_users_on_resets_requested` (`resets_requested`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `work_links`; @@ -1683,7 +1707,7 @@ DROP TABLE IF EXISTS `work_links`; CREATE TABLE `work_links` ( `id` int(11) NOT NULL AUTO_INCREMENT, `work_id` int(11) DEFAULT NULL, - `url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `url` varchar(255) DEFAULT NULL, `count` int(11) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, @@ -1691,42 +1715,57 @@ CREATE TABLE `work_links` ( UNIQUE KEY `work_links_work_id_url` (`work_id`,`url`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `work_original_creators`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `work_original_creators` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `work_id` bigint(20) NOT NULL, + `user_id` bigint(20) NOT NULL, + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `index_work_original_creators_on_work_id_and_user_id` (`work_id`,`user_id`), + KEY `index_work_original_creators_on_work_id` (`work_id`), + KEY `index_work_original_creators_on_user_id` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `works`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `works` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `expected_number_of_chapters` int(11) DEFAULT '1', + `expected_number_of_chapters` int(11) DEFAULT 1, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, - `major_version` int(11) DEFAULT '1', - `minor_version` int(11) DEFAULT '0', - `posted` tinyint(1) NOT NULL DEFAULT '0', + `major_version` int(11) DEFAULT 1, + `minor_version` int(11) DEFAULT 0, + `posted` tinyint(1) NOT NULL DEFAULT 0, `language_id` int(11) DEFAULT NULL, - `restricted` tinyint(1) NOT NULL DEFAULT '0', - `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `summary` text COLLATE utf8mb4_unicode_ci, - `notes` text COLLATE utf8mb4_unicode_ci, + `restricted` tinyint(1) NOT NULL DEFAULT 0, + `title` varchar(255) NOT NULL, + `summary` text DEFAULT NULL, + `notes` text DEFAULT NULL, `word_count` int(11) DEFAULT NULL, - `hidden_by_admin` tinyint(1) NOT NULL DEFAULT '0', - `delta` tinyint(1) DEFAULT '0', + `hidden_by_admin` tinyint(1) NOT NULL DEFAULT 0, + `delta` tinyint(1) DEFAULT 0, `revised_at` datetime DEFAULT NULL, - `title_to_sort_on` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `backdate` tinyint(1) NOT NULL DEFAULT '0', - `endnotes` text COLLATE utf8mb4_unicode_ci, - `imported_from_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `complete` tinyint(1) NOT NULL DEFAULT '0', - `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `notes_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', - `endnotes_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', + `title_to_sort_on` varchar(255) DEFAULT NULL, + `backdate` tinyint(1) NOT NULL DEFAULT 0, + `endnotes` text DEFAULT NULL, + `imported_from_url` varchar(255) DEFAULT NULL, + `complete` tinyint(1) NOT NULL DEFAULT 0, + `summary_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `notes_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, + `endnotes_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, `work_skin_id` int(11) DEFAULT NULL, - `in_anon_collection` tinyint(1) NOT NULL DEFAULT '0', - `in_unrevealed_collection` tinyint(1) NOT NULL DEFAULT '0', - `ip_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `spam` tinyint(1) NOT NULL DEFAULT '0', + `in_anon_collection` tinyint(1) NOT NULL DEFAULT 0, + `in_unrevealed_collection` tinyint(1) NOT NULL DEFAULT 0, + `ip_address` varchar(255) DEFAULT NULL, + `spam` tinyint(1) NOT NULL DEFAULT 0, `spam_checked_at` datetime DEFAULT NULL, - `moderated_commenting_enabled` tinyint(1) NOT NULL DEFAULT '0', - `comment_permissions` tinyint(4) NOT NULL DEFAULT '0', + `moderated_commenting_enabled` tinyint(1) NOT NULL DEFAULT 0, + `comment_permissions` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `index_works_on_language_id` (`language_id`), KEY `index_works_on_imported_from_url` (`imported_from_url`), @@ -1756,20 +1795,15 @@ DROP TABLE IF EXISTS `wrangling_guidelines`; CREATE TABLE `wrangling_guidelines` ( `id` int(11) NOT NULL AUTO_INCREMENT, `admin_id` int(11) DEFAULT NULL, - `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `content` text COLLATE utf8mb4_unicode_ci, + `title` varchar(255) DEFAULT NULL, + `content` text DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `position` int(11) DEFAULT NULL, - `content_sanitizer_version` smallint(6) NOT NULL DEFAULT '0', + `content_sanitizer_version` smallint(6) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; -SET @@SESSION.SQL_LOG_BIN = @MYSQLDUMP_TEMP_LOG_BIN; -/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; -/*!50112 PREPARE s FROM @disable_bulk_load */; -/*!50112 EXECUTE s */; -/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2117,6 +2151,30 @@ INSERT INTO `schema_migrations` (version) VALUES ('20200814233538'), ('20200829050124'), ('20201210140123'), -('20201214013251'); - - +('20201214013251'), +('20210603151906'), +('20210625232846'), +('20210626010047'), +('20210831214137'), +('20210902040827'), +('20211204001151'), +('20211205115025'), +('20211230202951'), +('20220212222625'), +('20220519071139'), +('20220622075958'), +('20220821213412'), +('20220911173601'), +('20220918015954'), +('20221205223816'), +('20221218033319'), +('20230106203903'), +('20230113225105'), +('20230113225128'), +('20230408145819'), +('20230429120200'), +('20230610162442'), +('20230717161221'), +('20230819074500'), +('20230903180114'), +('20230920094945');