Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added saved searches model #743

Merged
merged 2 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions db/migrate/20240606002826_create_saved_searches.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class CreateSavedSearches < ActiveRecord::Migration[6.1]
def change
create_table :saved_searches do |t|
t.references :user, foreign_key: true
t.string :name
t.jsonb :search, null: false, default: '{}'
t.timestamps
end
end
end
14 changes: 13 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2024_04_04_032142) do
ActiveRecord::Schema.define(version: 2024_06_06_002826) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -168,6 +168,7 @@
t.datetime "updated_at", null: false
t.integer "feature_rank"
t.boolean "is_parent", default: false
t.integer "parent_id"
t.index ["feature_rank"], name: "index_eligibilities_on_feature_rank"
t.index ["name"], name: "index_eligibilities_on_name", unique: true
end
Expand Down Expand Up @@ -358,6 +359,15 @@
t.index ["feedback_id"], name: "index_reviews_on_feedback_id"
end

create_table "saved_searches", force: :cascade do |t|
t.bigint "user_id"
t.string "name"
t.jsonb "search", default: "{}", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["user_id"], name: "index_saved_searches_on_user_id"
end

create_table "schedule_days", force: :cascade do |t|
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
Expand Down Expand Up @@ -487,6 +497,7 @@
add_foreign_key "change_requests", "resources"
add_foreign_key "contacts", "resources"
add_foreign_key "contacts", "services"
add_foreign_key "eligibilities", "eligibilities", column: "parent_id"
add_foreign_key "feedbacks", "resources"
add_foreign_key "feedbacks", "services"
add_foreign_key "field_changes", "change_requests"
Expand All @@ -506,6 +517,7 @@
add_foreign_key "resources_sites", "resources"
add_foreign_key "resources_sites", "sites"
add_foreign_key "reviews", "feedbacks"
add_foreign_key "saved_searches", "users"
add_foreign_key "schedule_days", "schedules"
add_foreign_key "schedules", "resources"
add_foreign_key "schedules", "services"
Expand Down