add rfid_tag model
This commit is contained in:
parent
ac5faa4475
commit
240c94d1dd
5 changed files with 38 additions and 1 deletions
2
app/models/rfid_tag.rb
Normal file
2
app/models/rfid_tag.rb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
class RfidTag < ApplicationRecord
|
||||
end
|
||||
11
db/migrate/20250806151318_create_rfid_tags.rb
Normal file
11
db/migrate/20250806151318_create_rfid_tags.rb
Normal file
|
|
@ -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
|
||||
10
db/schema.rb
generated
10
db/schema.rb
generated
|
|
@ -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
|
||||
|
|
|
|||
9
test/fixtures/rfid_tags.yml
vendored
Normal file
9
test/fixtures/rfid_tags.yml
vendored
Normal file
|
|
@ -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
|
||||
7
test/models/rfid_tag_test.rb
Normal file
7
test/models/rfid_tag_test.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
require "test_helper"
|
||||
|
||||
class RfidTagTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue