diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-08-09 16:25:32 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-08-09 16:25:32 +0200 |
| commit | 5d33a8ae2b14260ec045342b7ca56def03914e09 (patch) | |
| tree | 46f47a206af1be74d340ff8705dc980f6071b354 /db/schema.rb | |
| parent | 0f4288d91de7b48f7bbed832ca80246b0055cc64 (diff) | |
Make db/schema.rb the authoritative database description
Diffstat (limited to 'db/schema.rb')
| -rw-r--r-- | db/schema.rb | 224 |
1 files changed, 224 insertions, 0 deletions
diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 00000000..05dc1ef1 --- /dev/null +++ b/db/schema.rb | |||
| @@ -0,0 +1,224 @@ | |||
| 1 | # This file is auto-generated from the current state of the database. Instead | ||
| 2 | # of editing this file, please use the migrations feature of Active Record to | ||
| 3 | # incrementally modify your database, and then regenerate this schema definition. | ||
| 4 | # | ||
| 5 | # This file is the source Rails uses to define your schema when running `bin/rails | ||
| 6 | # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to | ||
| 7 | # be faster and is potentially less error prone than running all of your | ||
| 8 | # migrations from scratch. Old migrations may fail to apply correctly if those | ||
| 9 | # migrations use external dependencies or application code. | ||
| 10 | # | ||
| 11 | # It's strongly recommended that you check this file into your version control system. | ||
| 12 | |||
| 13 | ActiveRecord::Schema[8.1].define(version: 2026_08_09_135746) do | ||
| 14 | # These are extensions that must be enabled in order to support this database | ||
| 15 | enable_extension "pg_catalog.plpgsql" | ||
| 16 | |||
| 17 | create_table "action_participants", force: :cascade do |t| | ||
| 18 | t.bigint "node_action_id", null: false | ||
| 19 | t.bigint "subject_id", null: false | ||
| 20 | t.string "subject_type", null: false | ||
| 21 | t.index ["node_action_id", "subject_type", "subject_id"], name: "index_action_participants_uniqueness", unique: true | ||
| 22 | t.index ["subject_type", "subject_id", "node_action_id"], name: "index_action_participants_on_subject_and_action" | ||
| 23 | end | ||
| 24 | |||
| 25 | create_table "assets", id: :serial, force: :cascade do |t| | ||
| 26 | t.datetime "created_at", precision: nil | ||
| 27 | t.string "creator" | ||
| 28 | t.string "license_key" | ||
| 29 | t.string "name", limit: 255 | ||
| 30 | t.string "source_url" | ||
| 31 | t.datetime "updated_at", precision: nil | ||
| 32 | t.string "upload_content_type", limit: 255 | ||
| 33 | t.string "upload_file_name", limit: 255 | ||
| 34 | t.integer "upload_file_size" | ||
| 35 | t.datetime "upload_updated_at", precision: nil | ||
| 36 | end | ||
| 37 | |||
| 38 | create_table "events", id: :serial, force: :cascade do |t| | ||
| 39 | t.boolean "allday" | ||
| 40 | t.datetime "created_at", precision: nil | ||
| 41 | t.text "description" | ||
| 42 | t.datetime "end_time", precision: nil | ||
| 43 | t.float "latitude" | ||
| 44 | t.text "location" | ||
| 45 | t.float "longitude" | ||
| 46 | t.integer "node_id" | ||
| 47 | t.string "rrule", limit: 255 | ||
| 48 | t.datetime "start_time", precision: nil | ||
| 49 | t.string "title" | ||
| 50 | t.datetime "updated_at", precision: nil | ||
| 51 | t.string "url", limit: 255 | ||
| 52 | end | ||
| 53 | |||
| 54 | create_table "flags_pages", id: false, force: :cascade do |t| | ||
| 55 | t.integer "flag_id" | ||
| 56 | t.integer "page_id" | ||
| 57 | t.index ["flag_id"], name: "index_flags_pages_on_flag_id" | ||
| 58 | t.index ["page_id"], name: "index_flags_pages_on_page_id" | ||
| 59 | end | ||
| 60 | |||
| 61 | create_table "intern_mail_sent", id: false, force: :cascade do |t| | ||
| 62 | t.integer "node_id" | ||
| 63 | end | ||
| 64 | |||
| 65 | create_table "menu_item_translations", id: :serial, force: :cascade do |t| | ||
| 66 | t.datetime "created_at", precision: nil | ||
| 67 | t.string "locale", limit: 255 | ||
| 68 | t.integer "menu_item_id" | ||
| 69 | t.string "title", limit: 255 | ||
| 70 | t.datetime "updated_at", precision: nil | ||
| 71 | end | ||
| 72 | |||
| 73 | create_table "menu_items", id: :serial, force: :cascade do |t| | ||
| 74 | t.datetime "created_at", precision: nil | ||
| 75 | t.integer "node_id" | ||
| 76 | t.string "path", limit: 255 | ||
| 77 | t.integer "position" | ||
| 78 | t.string "type", limit: 255 | ||
| 79 | t.integer "type_id" | ||
| 80 | t.datetime "updated_at", precision: nil | ||
| 81 | end | ||
| 82 | |||
| 83 | create_table "node_actions", force: :cascade do |t| | ||
| 84 | t.string "action", null: false | ||
| 85 | t.datetime "created_at", null: false | ||
| 86 | t.string "inferred_from" | ||
| 87 | t.string "locale" | ||
| 88 | t.jsonb "metadata", null: false | ||
| 89 | t.bigint "node_id" | ||
| 90 | t.datetime "occurred_at", null: false | ||
| 91 | t.bigint "page_id" | ||
| 92 | t.datetime "updated_at", null: false | ||
| 93 | t.bigint "user_id" | ||
| 94 | t.index ["action"], name: "index_node_actions_on_action" | ||
| 95 | t.index ["node_id", "occurred_at"], name: "index_node_actions_on_node_id_and_occurred_at" | ||
| 96 | t.index ["node_id"], name: "index_node_actions_on_node_id" | ||
| 97 | t.index ["page_id"], name: "index_node_actions_on_page_id" | ||
| 98 | t.index ["user_id"], name: "index_node_actions_on_user_id" | ||
| 99 | end | ||
| 100 | |||
| 101 | create_table "nodes", id: :serial, force: :cascade do |t| | ||
| 102 | t.integer "autosave_id" | ||
| 103 | t.datetime "created_at", precision: nil | ||
| 104 | t.string "default_template_name" | ||
| 105 | t.integer "draft_id" | ||
| 106 | t.integer "head_id" | ||
| 107 | t.integer "locking_user_id" | ||
| 108 | t.integer "parent_id" | ||
| 109 | t.string "slug", limit: 255 | ||
| 110 | t.string "unique_name", limit: 255 | ||
| 111 | t.datetime "updated_at", precision: nil | ||
| 112 | t.index ["draft_id"], name: "index_nodes_on_draft_id" | ||
| 113 | t.index ["head_id"], name: "index_nodes_on_head_id" | ||
| 114 | t.index ["id"], name: "index_nodes_on_id" | ||
| 115 | t.index ["locking_user_id"], name: "index_nodes_on_locking_user_id" | ||
| 116 | t.index ["parent_id"], name: "index_nodes_on_parent_id" | ||
| 117 | t.index ["slug"], name: "index_nodes_on_slug" | ||
| 118 | t.index ["unique_name"], name: "index_nodes_on_unique_name" | ||
| 119 | end | ||
| 120 | |||
| 121 | create_table "occurrences", id: :serial, force: :cascade do |t| | ||
| 122 | t.datetime "created_at", precision: nil | ||
| 123 | t.datetime "end_time", precision: nil | ||
| 124 | t.integer "event_id" | ||
| 125 | t.integer "node_id" | ||
| 126 | t.datetime "start_time", precision: nil | ||
| 127 | t.datetime "updated_at", precision: nil | ||
| 128 | t.index ["event_id"], name: "index_occurrences_on_event_id" | ||
| 129 | end | ||
| 130 | |||
| 131 | create_table "page_translations", id: :serial, force: :cascade do |t| | ||
| 132 | t.text "abstract" | ||
| 133 | t.text "body" | ||
| 134 | t.datetime "created_at", precision: nil | ||
| 135 | t.string "locale", limit: 255 | ||
| 136 | t.integer "page_id" | ||
| 137 | t.tsvector "search_vector" | ||
| 138 | t.string "title", limit: 255 | ||
| 139 | t.datetime "updated_at", precision: nil | ||
| 140 | t.index ["locale"], name: "index_page_translations_on_locale" | ||
| 141 | t.index ["page_id"], name: "index_page_translations_on_page_id" | ||
| 142 | t.index ["search_vector"], name: "index_page_translations_on_search_vector", using: :gin | ||
| 143 | end | ||
| 144 | |||
| 145 | create_table "pages", id: :serial, force: :cascade do |t| | ||
| 146 | t.datetime "created_at", precision: nil | ||
| 147 | t.integer "editor_id" | ||
| 148 | t.string "external_url" | ||
| 149 | t.integer "node_id" | ||
| 150 | t.integer "parent_node_id" | ||
| 151 | t.string "preview_token" | ||
| 152 | t.datetime "published_at", precision: nil | ||
| 153 | t.integer "revision" | ||
| 154 | t.string "slug" | ||
| 155 | t.string "template_name", limit: 255 | ||
| 156 | t.datetime "updated_at", precision: nil | ||
| 157 | t.integer "user_id" | ||
| 158 | t.index ["id"], name: "index_pages_on_id" | ||
| 159 | t.index ["node_id"], name: "index_pages_on_node_id" | ||
| 160 | t.index ["preview_token"], name: "index_pages_on_preview_token", unique: true | ||
| 161 | t.index ["revision"], name: "index_pages_on_revision" | ||
| 162 | t.index ["user_id"], name: "index_pages_on_user_id" | ||
| 163 | end | ||
| 164 | |||
| 165 | create_table "related_assets", id: :serial, force: :cascade do |t| | ||
| 166 | t.integer "asset_id" | ||
| 167 | t.datetime "created_at", precision: nil | ||
| 168 | t.boolean "headline", default: false, null: false | ||
| 169 | t.integer "page_id" | ||
| 170 | t.integer "position", default: 1 | ||
| 171 | t.datetime "updated_at", precision: nil | ||
| 172 | t.index ["page_id"], name: "index_related_assets_on_page_id_headline_uniqueness", unique: true, where: "(headline = true)" | ||
| 173 | end | ||
| 174 | |||
| 175 | create_table "taggings", id: :serial, force: :cascade do |t| | ||
| 176 | t.string "context", limit: 255 | ||
| 177 | t.datetime "created_at", precision: nil | ||
| 178 | t.integer "tag_id" | ||
| 179 | t.integer "taggable_id" | ||
| 180 | t.string "taggable_type", limit: 255 | ||
| 181 | t.integer "tagger_id" | ||
| 182 | t.string "tagger_type", limit: 255 | ||
| 183 | t.integer "user_id" | ||
| 184 | t.index ["context"], name: "index_taggings_on_context" | ||
| 185 | t.index ["tag_id"], name: "index_taggings_on_tag_id" | ||
| 186 | t.index ["taggable_id", "taggable_type", "tagger_id", "context"], name: "taggings_idy" | ||
| 187 | t.index ["taggable_id", "taggable_type"], name: "index_taggings_on_taggable_id_and_taggable_type" | ||
| 188 | t.index ["taggable_id"], name: "index_taggings_on_taggable_id" | ||
| 189 | t.index ["taggable_type"], name: "index_taggings_on_taggable_type" | ||
| 190 | t.index ["tagger_id", "tagger_type"], name: "index_taggings_on_tagger_id_and_tagger_type" | ||
| 191 | t.index ["tagger_id"], name: "index_taggings_on_tagger_id" | ||
| 192 | t.index ["user_id", "tag_id", "taggable_type"], name: "index_taggings_on_user_id_and_tag_id_and_taggable_type" | ||
| 193 | t.index ["user_id", "taggable_id", "taggable_type"], name: "index_taggings_on_user_id_and_taggable_id_and_taggable_type" | ||
| 194 | end | ||
| 195 | |||
| 196 | create_table "tags", id: :serial, force: :cascade do |t| | ||
| 197 | t.string "name", limit: 255 | ||
| 198 | t.integer "taggings_count", default: 0, null: false | ||
| 199 | t.index ["name"], name: "index_tags_on_name" | ||
| 200 | t.index ["taggings_count"], name: "index_tags_on_taggings_count" | ||
| 201 | end | ||
| 202 | |||
| 203 | create_table "users", id: :serial, force: :cascade do |t| | ||
| 204 | t.datetime "created_at", precision: nil | ||
| 205 | t.string "crypted_password", limit: 255 | ||
| 206 | t.string "email", limit: 255 | ||
| 207 | t.datetime "last_login_at" | ||
| 208 | t.string "login", limit: 255 | ||
| 209 | t.integer "otp_consumed_timestep" | ||
| 210 | t.string "otp_pending_secret" | ||
| 211 | t.boolean "otp_required", default: false, null: false | ||
| 212 | t.string "otp_secret" | ||
| 213 | t.string "password_digest" | ||
| 214 | t.string "roles", default: [], null: false, array: true | ||
| 215 | t.string "salt", limit: 255 | ||
| 216 | t.datetime "updated_at", precision: nil | ||
| 217 | end | ||
| 218 | |||
| 219 | add_foreign_key "action_participants", "node_actions" | ||
| 220 | add_foreign_key "node_actions", "nodes", on_delete: :nullify | ||
| 221 | add_foreign_key "node_actions", "pages", on_delete: :nullify | ||
| 222 | add_foreign_key "node_actions", "users", on_delete: :nullify | ||
| 223 | add_foreign_key "occurrences", "events", on_delete: :cascade, deferrable: :immediate | ||
| 224 | end | ||
