diff options
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20251029130829_create_visits.rb | 9 | ||||
| -rw-r--r-- | db/schema.rb | 10 |
2 files changed, 18 insertions, 1 deletions
diff --git a/db/migrate/20251029130829_create_visits.rb b/db/migrate/20251029130829_create_visits.rb new file mode 100644 index 0000000..a6301e3 --- /dev/null +++ b/db/migrate/20251029130829_create_visits.rb @@ -0,0 +1,9 @@ +class CreateVisits < ActiveRecord::Migration[8.1] + def change + create_table :visits do |t| + t.references :client, null: false, foreign_key: true + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index fe7b52f..52a6a4c 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_29_010650) do +ActiveRecord::Schema[8.1].define(version: 2025_10_29_130829) do # These are extensions that must be enabled in order to support this database enable_extension "pg_catalog.plpgsql" @@ -39,5 +39,13 @@ ActiveRecord::Schema[8.1].define(version: 2025_10_29_010650) do t.index ["email_address"], name: "index_users_on_email_address", unique: true end + create_table "visits", force: :cascade do |t| + t.bigint "client_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["client_id"], name: "index_visits_on_client_id" + end + add_foreign_key "sessions", "users" + add_foreign_key "visits", "clients" end |
