2013-03-04 12:42:59 -05:00
|
|
|
# This file is auto-generated from the current state of the database. Instead
|
|
|
|
# of editing this file, please use the migrations feature of Active Record to
|
|
|
|
# incrementally modify your database, and then regenerate this schema definition.
|
|
|
|
#
|
2024-07-19 14:00:19 +03:00
|
|
|
# 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.
|
2013-03-04 12:42:59 -05:00
|
|
|
#
|
2013-07-24 10:14:46 -05:00
|
|
|
# It's strongly recommended that you check this file into your version control system.
|
2013-03-04 12:42:59 -05:00
|
|
|
|
2020-08-20 02:37:55 +03:00
|
|
|
ActiveRecord::Schema.define(version: 2020_08_20_000743) do
|
2015-08-05 13:01:02 +02:00
|
|
|
|
2024-07-19 14:00:19 +03:00
|
|
|
# These are extensions that must be enabled in order to support this database
|
|
|
|
enable_extension "plpgsql"
|
|
|
|
|
|
|
|
create_table "attachments", force: :cascade do |t|
|
|
|
|
t.bigint "todo_id"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.string "file_file_name"
|
|
|
|
t.string "file_content_type"
|
2024-07-19 14:00:19 +03:00
|
|
|
t.bigint "file_file_size"
|
2015-08-05 13:01:02 +02:00
|
|
|
t.datetime "file_updated_at"
|
2024-07-19 14:00:19 +03:00
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2018-11-20 19:56:50 -06:00
|
|
|
t.index ["todo_id"], name: "index_attachments_on_todo_id"
|
2015-08-05 13:01:02 +02:00
|
|
|
end
|
|
|
|
|
2024-07-19 14:00:19 +03:00
|
|
|
create_table "contexts", force: :cascade do |t|
|
2018-11-20 19:56:50 -06:00
|
|
|
t.string "name", null: false
|
2024-07-19 14:00:19 +03:00
|
|
|
t.integer "position"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.integer "user_id", default: 1
|
2013-03-04 12:42:59 -05:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.string "state", limit: 20, default: "active", null: false
|
|
|
|
t.index ["user_id", "name"], name: "index_contexts_on_user_id_and_name"
|
|
|
|
t.index ["user_id"], name: "index_contexts_on_user_id"
|
2013-03-04 12:42:59 -05:00
|
|
|
end
|
|
|
|
|
2024-07-19 14:00:19 +03:00
|
|
|
create_table "dependencies", force: :cascade do |t|
|
2018-11-20 19:56:50 -06:00
|
|
|
t.integer "successor_id", null: false
|
|
|
|
t.integer "predecessor_id", null: false
|
|
|
|
t.string "relationship_type"
|
|
|
|
t.index ["predecessor_id"], name: "index_dependencies_on_predecessor_id"
|
|
|
|
t.index ["successor_id"], name: "index_dependencies_on_successor_id"
|
2013-03-04 12:42:59 -05:00
|
|
|
end
|
|
|
|
|
2024-07-19 14:00:19 +03:00
|
|
|
create_table "notes", force: :cascade do |t|
|
2018-11-20 19:56:50 -06:00
|
|
|
t.integer "user_id", null: false
|
|
|
|
t.integer "project_id", null: false
|
|
|
|
t.text "body"
|
2013-03-04 12:42:59 -05:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.index ["project_id"], name: "index_notes_on_project_id"
|
|
|
|
t.index ["user_id"], name: "index_notes_on_user_id"
|
2013-03-04 12:42:59 -05:00
|
|
|
end
|
|
|
|
|
2024-07-19 14:00:19 +03:00
|
|
|
create_table "open_id_authentication_associations", force: :cascade do |t|
|
2013-03-04 12:42:59 -05:00
|
|
|
t.integer "issued"
|
|
|
|
t.integer "lifetime"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.string "handle"
|
|
|
|
t.string "assoc_type"
|
|
|
|
t.binary "server_url"
|
|
|
|
t.binary "secret"
|
|
|
|
end
|
|
|
|
|
2024-07-19 14:00:19 +03:00
|
|
|
create_table "open_id_authentication_nonces", force: :cascade do |t|
|
2018-11-20 19:56:50 -06:00
|
|
|
t.integer "timestamp", null: false
|
|
|
|
t.string "server_url"
|
|
|
|
t.string "salt", null: false
|
|
|
|
end
|
|
|
|
|
2024-07-19 14:00:19 +03:00
|
|
|
create_table "preferences", force: :cascade do |t|
|
2018-11-20 19:56:50 -06:00
|
|
|
t.integer "user_id", null: false
|
|
|
|
t.string "date_format", limit: 40, default: "%d/%m/%Y", null: false
|
|
|
|
t.integer "week_starts", default: 0, null: false
|
|
|
|
t.integer "show_number_completed", default: 5, null: false
|
|
|
|
t.integer "staleness_starts", default: 7, null: false
|
|
|
|
t.boolean "show_completed_projects_in_sidebar", default: true, null: false
|
|
|
|
t.boolean "show_hidden_contexts_in_sidebar", default: true, null: false
|
|
|
|
t.integer "due_style", default: 0, null: false
|
|
|
|
t.integer "refresh", default: 0, null: false
|
|
|
|
t.boolean "verbose_action_descriptors", default: false, null: false
|
|
|
|
t.boolean "show_hidden_projects_in_sidebar", default: true, null: false
|
2024-07-19 14:00:19 +03:00
|
|
|
t.string "time_zone", limit: 255, default: "London", null: false
|
2018-11-20 19:56:50 -06:00
|
|
|
t.boolean "show_project_on_todo_done", default: false, null: false
|
2024-07-19 14:00:19 +03:00
|
|
|
t.string "title_date_format", limit: 255, default: "%A, %d %B %Y", null: false
|
2018-11-20 19:56:50 -06:00
|
|
|
t.integer "mobile_todos_per_page", default: 6, null: false
|
|
|
|
t.string "sms_email"
|
2013-03-04 12:42:59 -05:00
|
|
|
t.integer "sms_context_id"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.string "locale"
|
|
|
|
t.integer "review_period", default: 14, null: false
|
2020-08-20 02:37:55 +03:00
|
|
|
t.string "theme"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.index ["user_id"], name: "index_preferences_on_user_id"
|
2013-03-04 12:42:59 -05:00
|
|
|
end
|
|
|
|
|
2024-07-19 14:00:19 +03:00
|
|
|
create_table "projects", force: :cascade do |t|
|
2018-11-20 19:56:50 -06:00
|
|
|
t.string "name", null: false
|
2024-07-19 14:00:19 +03:00
|
|
|
t.integer "position"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.integer "user_id", default: 1
|
2024-07-19 14:00:19 +03:00
|
|
|
t.text "description"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.string "state", limit: 20, null: false
|
2013-03-04 12:42:59 -05:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.integer "default_context_id"
|
2013-03-04 12:42:59 -05:00
|
|
|
t.datetime "completed_at"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.string "default_tags"
|
2013-03-04 12:42:59 -05:00
|
|
|
t.datetime "last_reviewed"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.index ["state"], name: "index_projects_on_state"
|
|
|
|
t.index ["user_id", "name"], name: "index_projects_on_user_id_and_name"
|
|
|
|
t.index ["user_id", "state"], name: "index_projects_on_user_id_and_state"
|
|
|
|
t.index ["user_id"], name: "index_projects_on_user_id"
|
|
|
|
end
|
|
|
|
|
2024-07-19 14:00:19 +03:00
|
|
|
create_table "recurring_todos", force: :cascade do |t|
|
2018-11-20 19:56:50 -06:00
|
|
|
t.integer "user_id", default: 1
|
|
|
|
t.integer "context_id", null: false
|
|
|
|
t.integer "project_id"
|
|
|
|
t.string "description", null: false
|
2024-07-19 14:00:19 +03:00
|
|
|
t.text "notes"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.string "state", limit: 20, null: false
|
2013-03-04 12:42:59 -05:00
|
|
|
t.datetime "start_from"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.string "ends_on"
|
2013-03-04 12:42:59 -05:00
|
|
|
t.datetime "end_date"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.integer "number_of_occurrences"
|
|
|
|
t.integer "occurrences_count", default: 0
|
|
|
|
t.string "target"
|
|
|
|
t.integer "show_from_delta"
|
|
|
|
t.string "recurring_period"
|
|
|
|
t.integer "recurrence_selector"
|
|
|
|
t.integer "every_other1"
|
|
|
|
t.integer "every_other2"
|
|
|
|
t.integer "every_other3"
|
|
|
|
t.string "every_day"
|
|
|
|
t.boolean "only_work_days", default: false
|
|
|
|
t.integer "every_count"
|
|
|
|
t.integer "weekday"
|
2013-03-04 12:42:59 -05:00
|
|
|
t.datetime "completed_at"
|
2024-07-19 14:00:19 +03:00
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2018-11-20 19:56:50 -06:00
|
|
|
t.boolean "show_always"
|
|
|
|
t.index ["state"], name: "index_recurring_todos_on_state"
|
|
|
|
t.index ["user_id"], name: "index_recurring_todos_on_user_id"
|
2013-03-04 12:42:59 -05:00
|
|
|
end
|
|
|
|
|
2024-07-19 14:00:19 +03:00
|
|
|
create_table "sessions", force: :cascade do |t|
|
2018-11-20 19:56:50 -06:00
|
|
|
t.string "session_id"
|
|
|
|
t.text "data"
|
2013-03-04 12:42:59 -05:00
|
|
|
t.datetime "updated_at"
|
2024-07-19 14:00:19 +03:00
|
|
|
t.index ["session_id"], name: "index_sessions_on_session_id"
|
2013-03-04 12:42:59 -05:00
|
|
|
end
|
|
|
|
|
2024-07-19 14:00:19 +03:00
|
|
|
create_table "taggings", force: :cascade do |t|
|
2013-03-04 12:42:59 -05:00
|
|
|
t.integer "taggable_id"
|
|
|
|
t.integer "tag_id"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.string "taggable_type"
|
|
|
|
t.index ["tag_id", "taggable_id", "taggable_type"], name: "index_taggings_on_tag_id_and_taggable_id_and_taggable_type"
|
|
|
|
t.index ["tag_id"], name: "index_taggings_on_tag_id"
|
|
|
|
t.index ["taggable_id", "taggable_type"], name: "index_taggings_on_taggable_id_and_taggable_type"
|
2013-03-04 12:42:59 -05:00
|
|
|
end
|
|
|
|
|
2024-07-19 14:00:19 +03:00
|
|
|
create_table "tags", force: :cascade do |t|
|
2018-11-20 19:56:50 -06:00
|
|
|
t.string "name"
|
2013-03-04 12:42:59 -05:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2019-06-25 03:15:23 +03:00
|
|
|
t.integer "user_id"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.index ["name"], name: "index_tags_on_name"
|
2013-03-04 12:42:59 -05:00
|
|
|
end
|
|
|
|
|
2024-07-19 14:00:19 +03:00
|
|
|
create_table "todos", force: :cascade do |t|
|
2018-11-20 19:56:50 -06:00
|
|
|
t.integer "context_id", null: false
|
|
|
|
t.integer "project_id"
|
2020-01-13 15:19:23 -06:00
|
|
|
t.text "description", null: false
|
2024-07-19 14:00:19 +03:00
|
|
|
t.text "notes"
|
2013-03-04 12:42:59 -05:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "due"
|
|
|
|
t.datetime "completed_at"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.integer "user_id", default: 1
|
2013-03-04 12:42:59 -05:00
|
|
|
t.datetime "show_from"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.string "state", limit: 20, null: false
|
|
|
|
t.integer "recurring_todo_id"
|
2013-03-04 12:42:59 -05:00
|
|
|
t.datetime "updated_at"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.index ["context_id"], name: "index_todos_on_context_id"
|
|
|
|
t.index ["project_id"], name: "index_todos_on_project_id"
|
|
|
|
t.index ["state"], name: "index_todos_on_state"
|
|
|
|
t.index ["user_id", "context_id"], name: "index_todos_on_user_id_and_context_id"
|
|
|
|
t.index ["user_id", "project_id"], name: "index_todos_on_user_id_and_project_id"
|
|
|
|
t.index ["user_id", "state"], name: "index_todos_on_user_id_and_state"
|
2013-03-04 12:42:59 -05:00
|
|
|
end
|
|
|
|
|
2024-07-19 14:00:19 +03:00
|
|
|
create_table "tolk_locales", force: :cascade do |t|
|
2018-11-20 19:56:50 -06:00
|
|
|
t.string "name"
|
2013-03-04 12:42:59 -05:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.index ["name"], name: "index_tolk_locales_on_name", unique: true
|
2013-03-04 12:42:59 -05:00
|
|
|
end
|
|
|
|
|
2024-07-19 14:00:19 +03:00
|
|
|
create_table "tolk_phrases", force: :cascade do |t|
|
2018-11-20 19:56:50 -06:00
|
|
|
t.text "key"
|
2013-03-04 12:42:59 -05:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
|
2024-07-19 14:00:19 +03:00
|
|
|
create_table "tolk_translations", force: :cascade do |t|
|
2018-11-20 19:56:50 -06:00
|
|
|
t.integer "phrase_id"
|
|
|
|
t.integer "locale_id"
|
|
|
|
t.text "text"
|
|
|
|
t.text "previous_text"
|
|
|
|
t.boolean "primary_updated", default: false
|
2013-03-04 12:42:59 -05:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.index ["phrase_id", "locale_id"], name: "index_tolk_translations_on_phrase_id_and_locale_id", unique: true
|
|
|
|
end
|
|
|
|
|
2024-07-19 14:00:19 +03:00
|
|
|
create_table "users", force: :cascade do |t|
|
2018-11-20 19:56:50 -06:00
|
|
|
t.string "login", limit: 80, null: false
|
2024-07-19 14:00:19 +03:00
|
|
|
t.string "crypted_password", limit: 60, null: false
|
2018-11-20 19:56:50 -06:00
|
|
|
t.string "token"
|
|
|
|
t.boolean "is_admin", default: false, null: false
|
|
|
|
t.string "first_name"
|
|
|
|
t.string "last_name"
|
|
|
|
t.string "auth_type", default: "database", null: false
|
|
|
|
t.string "open_id_url"
|
|
|
|
t.string "remember_token"
|
2013-03-04 12:42:59 -05:00
|
|
|
t.datetime "remember_token_expires_at"
|
2020-07-20 19:38:15 +03:00
|
|
|
t.string "email"
|
2020-08-07 21:38:16 +03:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-08-10 16:54:48 +03:00
|
|
|
t.datetime "last_login_at"
|
2018-11-20 19:56:50 -06:00
|
|
|
t.index ["login"], name: "index_users_on_login"
|
2013-03-04 12:42:59 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|