diff --git a/app/models/rfid_tag.rb b/app/models/rfid_tag.rb new file mode 100644 index 0000000..88efdc8 --- /dev/null +++ b/app/models/rfid_tag.rb @@ -0,0 +1,2 @@ +class RfidTag < ApplicationRecord +end diff --git a/db/migrate/20250806151318_create_rfid_tags.rb b/db/migrate/20250806151318_create_rfid_tags.rb new file mode 100644 index 0000000..9153624 --- /dev/null +++ b/db/migrate/20250806151318_create_rfid_tags.rb @@ -0,0 +1,11 @@ +class CreateRfidTags < ActiveRecord::Migration[8.0] + def change + create_table :rfid_tags do |t| + t.string :identifier + t.string :mode + t.index :identifier, unique: true + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 0c88c93..3e37d4f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,11 +10,19 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[8.0].define(version: 2025_07_07_090344) do +ActiveRecord::Schema[8.0].define(version: 2025_08_06_151318) do create_table "moods", force: :cascade do |t| t.string "mode" t.datetime "recorded_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false end + + create_table "rfid_tags", force: :cascade do |t| + t.string "identifier" + t.string "mode" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["identifier"], name: "index_rfid_tags_on_identifier", unique: true + end end diff --git a/test/fixtures/rfid_tags.yml b/test/fixtures/rfid_tags.yml new file mode 100644 index 0000000..42a3abe --- /dev/null +++ b/test/fixtures/rfid_tags.yml @@ -0,0 +1,9 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + identifier: MyString + mode: MyString + +two: + identifier: MyString + mode: MyString diff --git a/test/models/rfid_tag_test.rb b/test/models/rfid_tag_test.rb new file mode 100644 index 0000000..836a282 --- /dev/null +++ b/test/models/rfid_tag_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class RfidTagTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end