掲示板実装
This commit is contained in:
16
db/migrate/20260218084831_create_boards.rb
Normal file
16
db/migrate/20260218084831_create_boards.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class CreateBoards < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
create_table :boards do |t|
|
||||
t.integer :game_id, null: false
|
||||
t.string :board_type, null: false, default: 'negotiation'
|
||||
t.integer :created_by_participant_id
|
||||
t.boolean :is_public, null: false, default: false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :boards, :game_id
|
||||
add_index :boards, :board_type
|
||||
add_foreign_key :boards, :games
|
||||
end
|
||||
end
|
||||
19
db/migrate/20260218084842_create_board_memberships.rb
Normal file
19
db/migrate/20260218084842_create_board_memberships.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class CreateBoardMemberships < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
create_table :board_memberships do |t|
|
||||
t.integer :board_id, null: false
|
||||
t.integer :participant_id, null: false
|
||||
t.datetime :joined_at, null: false
|
||||
t.datetime :left_at
|
||||
t.integer :last_read_post_id
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :board_memberships, :board_id
|
||||
add_index :board_memberships, :participant_id
|
||||
add_index :board_memberships, [ :board_id, :participant_id ], unique: true
|
||||
add_foreign_key :board_memberships, :boards
|
||||
add_foreign_key :board_memberships, :participants
|
||||
end
|
||||
end
|
||||
17
db/migrate/20260218084851_create_board_posts.rb
Normal file
17
db/migrate/20260218084851_create_board_posts.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class CreateBoardPosts < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
create_table :board_posts do |t|
|
||||
t.integer :board_id, null: false
|
||||
t.integer :participant_id, null: false
|
||||
t.text :body, null: false
|
||||
t.string :phase
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :board_posts, :board_id
|
||||
add_index :board_posts, :participant_id
|
||||
add_foreign_key :board_posts, :boards
|
||||
add_foreign_key :board_posts, :participants
|
||||
end
|
||||
end
|
||||
17
db/migrate/20260218084903_create_board_proposals.rb
Normal file
17
db/migrate/20260218084903_create_board_proposals.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class CreateBoardProposals < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
create_table :board_proposals do |t|
|
||||
t.integer :board_id, null: false
|
||||
t.integer :proposer_participant_id, null: false
|
||||
t.text :body, null: false
|
||||
t.string :status, null: false, default: 'pending'
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :board_proposals, :board_id
|
||||
add_index :board_proposals, :proposer_participant_id
|
||||
add_foreign_key :board_proposals, :boards
|
||||
add_foreign_key :board_proposals, :participants, column: :proposer_participant_id
|
||||
end
|
||||
end
|
||||
13
db/migrate/20260218130000_create_solid_cable_messages.rb
Normal file
13
db/migrate/20260218130000_create_solid_cable_messages.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class CreateSolidCableMessages < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table "solid_cable_messages" do |t|
|
||||
t.binary "channel", limit: 1024, null: false
|
||||
t.binary "payload", limit: 536870912, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.integer "channel_hash", limit: 8, null: false
|
||||
t.index [ "channel" ], name: "index_solid_cable_messages_on_channel"
|
||||
t.index [ "channel_hash" ], name: "index_solid_cable_messages_on_channel_hash"
|
||||
t.index [ "created_at" ], name: "index_solid_cable_messages_on_created_at"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddPhaseToBoardProposals < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
add_column :board_proposals, :phase, :string
|
||||
end
|
||||
end
|
||||
66
db/schema.rb
generated
66
db/schema.rb
generated
@@ -10,7 +10,54 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.1].define(version: 2026_02_13_122531) do
|
||||
ActiveRecord::Schema[8.1].define(version: 2026_02_18_134459) do
|
||||
create_table "board_memberships", force: :cascade do |t|
|
||||
t.integer "board_id", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "joined_at", null: false
|
||||
t.integer "last_read_post_id"
|
||||
t.datetime "left_at"
|
||||
t.integer "participant_id", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["board_id", "participant_id"], name: "index_board_memberships_on_board_id_and_participant_id", unique: true
|
||||
t.index ["board_id"], name: "index_board_memberships_on_board_id"
|
||||
t.index ["participant_id"], name: "index_board_memberships_on_participant_id"
|
||||
end
|
||||
|
||||
create_table "board_posts", force: :cascade do |t|
|
||||
t.integer "board_id", null: false
|
||||
t.text "body", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.integer "participant_id", null: false
|
||||
t.string "phase"
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["board_id"], name: "index_board_posts_on_board_id"
|
||||
t.index ["participant_id"], name: "index_board_posts_on_participant_id"
|
||||
end
|
||||
|
||||
create_table "board_proposals", force: :cascade do |t|
|
||||
t.integer "board_id", null: false
|
||||
t.text "body", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.string "phase"
|
||||
t.integer "proposer_participant_id", null: false
|
||||
t.string "status", default: "pending", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["board_id"], name: "index_board_proposals_on_board_id"
|
||||
t.index ["proposer_participant_id"], name: "index_board_proposals_on_proposer_participant_id"
|
||||
end
|
||||
|
||||
create_table "boards", force: :cascade do |t|
|
||||
t.string "board_type", default: "negotiation", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.integer "created_by_participant_id"
|
||||
t.integer "game_id", null: false
|
||||
t.boolean "is_public", default: false, null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["board_type"], name: "index_boards_on_board_type"
|
||||
t.index ["game_id"], name: "index_boards_on_game_id"
|
||||
end
|
||||
|
||||
create_table "games", force: :cascade do |t|
|
||||
t.string "auto_order_mode", default: "hold", null: false
|
||||
t.datetime "created_at", null: false
|
||||
@@ -43,6 +90,16 @@ ActiveRecord::Schema[8.1].define(version: 2026_02_13_122531) do
|
||||
t.index ["user_id"], name: "index_participants_on_user_id"
|
||||
end
|
||||
|
||||
create_table "solid_cable_messages", force: :cascade do |t|
|
||||
t.binary "channel", limit: 1024, null: false
|
||||
t.integer "channel_hash", limit: 8, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.binary "payload", limit: 536870912, null: false
|
||||
t.index ["channel"], name: "index_solid_cable_messages_on_channel"
|
||||
t.index ["channel_hash"], name: "index_solid_cable_messages_on_channel_hash"
|
||||
t.index ["created_at"], name: "index_solid_cable_messages_on_created_at"
|
||||
end
|
||||
|
||||
create_table "solid_queue_blocked_executions", force: :cascade do |t|
|
||||
t.string "concurrency_key", null: false
|
||||
t.datetime "created_at", null: false
|
||||
@@ -189,6 +246,13 @@ ActiveRecord::Schema[8.1].define(version: 2026_02_13_122531) do
|
||||
t.index ["email"], name: "index_users_on_email", unique: true
|
||||
end
|
||||
|
||||
add_foreign_key "board_memberships", "boards"
|
||||
add_foreign_key "board_memberships", "participants"
|
||||
add_foreign_key "board_posts", "boards"
|
||||
add_foreign_key "board_posts", "participants"
|
||||
add_foreign_key "board_proposals", "boards"
|
||||
add_foreign_key "board_proposals", "participants", column: "proposer_participant_id"
|
||||
add_foreign_key "boards", "games"
|
||||
add_foreign_key "participants", "games"
|
||||
add_foreign_key "participants", "users"
|
||||
add_foreign_key "solid_queue_blocked_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
|
||||
Reference in New Issue
Block a user