basic entity get/show

This commit is contained in:
2023-01-13 21:47:31 +02:00
parent 26ea76c8e9
commit 38f51a5de6
13 changed files with 74 additions and 38 deletions

View File

@ -3,8 +3,9 @@ class CreateEntities < ActiveRecord::Migration[7.0]
create_table :entities do |t|
t.string :name
t.string :ha_id
t.string :type
t.references :member
t.string :ha_type
t.references :member, null: false, foreign_key: true
t.timestamps
end
end

5
db/schema.rb generated
View File

@ -17,8 +17,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_13_170732) do
create_table "entities", force: :cascade do |t|
t.string "name"
t.string "ha_id"
t.string "type"
t.bigint "member_id"
t.string "ha_type"
t.bigint "member_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["member_id"], name: "index_entities_on_member_id"
@ -287,6 +287,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_13_170732) do
t.index ["user_id", "postable_id"], name: "thredded_user_topic_read_states_user_postable", unique: true
end
add_foreign_key "entities", "members"
add_foreign_key "thredded_messageboard_users", "thredded_messageboards", on_delete: :cascade
add_foreign_key "thredded_messageboard_users", "thredded_user_details", on_delete: :cascade
add_foreign_key "thredded_user_post_notifications", "members", column: "user_id", on_delete: :cascade