diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2025-11-03 12:57:59 -0500 |
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-11-03 12:57:59 -0500 |
| commit | 02e64adf23b8b94b2575f33aa8a71fedab91d865 (patch) | |
| tree | bb071455c77baa53cbfc26ff761bbc5bb1076da2 | |
| parent | cbff355eac3b016a54240c077e774e3f871ce733 (diff) | |
db: index clients:uuid & visits:created_at
| -rw-r--r-- | db/migrate/20251103175210_add_index_to_uuid_on_clients.rb | 5 | ||||
| -rw-r--r-- | db/migrate/20251103175602_index_created_at_on_visits.rb | 5 | ||||
| -rw-r--r-- | db/schema.rb | 4 |
3 files changed, 13 insertions, 1 deletions
diff --git a/db/migrate/20251103175210_add_index_to_uuid_on_clients.rb b/db/migrate/20251103175210_add_index_to_uuid_on_clients.rb new file mode 100644 index 0000000..1455e79 --- /dev/null +++ b/db/migrate/20251103175210_add_index_to_uuid_on_clients.rb @@ -0,0 +1,5 @@ +class AddIndexToUuidOnClients < ActiveRecord::Migration[8.1] + def change + add_index :clients, :uuid, unique: true + end +end diff --git a/db/migrate/20251103175602_index_created_at_on_visits.rb b/db/migrate/20251103175602_index_created_at_on_visits.rb new file mode 100644 index 0000000..eea2ad2 --- /dev/null +++ b/db/migrate/20251103175602_index_created_at_on_visits.rb @@ -0,0 +1,5 @@ +class IndexCreatedAtOnVisits < ActiveRecord::Migration[8.1] + def change + add_index :visits, :created_at + end +end diff --git a/db/schema.rb b/db/schema.rb index 104a2e9..904f990 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[8.1].define(version: 2025_10_31_215930) do +ActiveRecord::Schema[8.1].define(version: 2025_11_03_175602) do # These are extensions that must be enabled in order to support this database enable_extension "pg_catalog.plpgsql" @@ -26,6 +26,7 @@ ActiveRecord::Schema[8.1].define(version: 2025_10_31_215930) do t.index ["first_name"], name: "index_clients_on_first_name" t.index ["last_name"], name: "index_clients_on_last_name" t.index ["mobile_number"], name: "index_clients_on_mobile_number", unique: true + t.index ["uuid"], name: "index_clients_on_uuid", unique: true end create_table "household_members", force: :cascade do |t| @@ -60,6 +61,7 @@ ActiveRecord::Schema[8.1].define(version: 2025_10_31_215930) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["client_id"], name: "index_visits_on_client_id" + t.index ["created_at"], name: "index_visits_on_created_at" end add_foreign_key "household_members", "clients" |
