diff --git a/app/models/park.rb b/app/models/park.rb new file mode 100644 index 0000000..a9df268 --- /dev/null +++ b/app/models/park.rb @@ -0,0 +1,2 @@ +class Park < ApplicationRecord +end diff --git a/db/migrate/20251008044109_create_parks.rb b/db/migrate/20251008044109_create_parks.rb new file mode 100644 index 0000000..6da2371 --- /dev/null +++ b/db/migrate/20251008044109_create_parks.rb @@ -0,0 +1,13 @@ +class CreateParks < ActiveRecord::Migration[8.0] + def change + create_table :parks do |t| + t.string :code, null: false + t.string :name, null: false + t.datetime :established_date, null: false + t.text :states, null: false + t.json :properties, null: false, default: {} + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 0f651a4..5cc40ca 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,5 +10,14 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[8.0].define(version: 0) do +ActiveRecord::Schema[8.0].define(version: 2025_10_08_044109) do + create_table "parks", force: :cascade do |t| + t.string "code", null: false + t.string "name", null: false + t.datetime "established_date", null: false + t.text "states", null: false + t.json "properties", default: {}, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end end diff --git a/test/fixtures/parks.yml b/test/fixtures/parks.yml new file mode 100644 index 0000000..4adcd4f --- /dev/null +++ b/test/fixtures/parks.yml @@ -0,0 +1,15 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + code: MyString + name: MyString + established_date: 2025-10-07 21:41:09 + states: MyText + properties: + +two: + code: MyString + name: MyString + established_date: 2025-10-07 21:41:09 + states: MyText + properties: diff --git a/test/models/park_test.rb b/test/models/park_test.rb new file mode 100644 index 0000000..8d2a64d --- /dev/null +++ b/test/models/park_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class ParkTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end