mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-08 15:05:22 +02:00
AI chat layout skeleton
This commit is contained in:
parent
dd75cadebc
commit
d1b83541c1
23 changed files with 231 additions and 1 deletions
10
db/migrate/20250312152948_create_chats.rb
Normal file
10
db/migrate/20250312152948_create_chats.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
class CreateChats < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :chats, id: :uuid do |t|
|
||||
t.timestamps
|
||||
|
||||
t.references :user, null: false, foreign_key: true, type: :uuid
|
||||
t.string :title, null: false
|
||||
end
|
||||
end
|
||||
end
|
12
db/migrate/20250312153208_create_messages.rb
Normal file
12
db/migrate/20250312153208_create_messages.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
class CreateMessages < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :messages, id: :uuid do |t|
|
||||
t.timestamps
|
||||
|
||||
t.references :chat, null: false, foreign_key: true, type: :uuid
|
||||
t.string :role, null: false
|
||||
t.text :content, null: false
|
||||
t.boolean :debug_mode, default: false, null: false
|
||||
end
|
||||
end
|
||||
end
|
5
db/migrate/20250312160915_user_latest_chat.rb
Normal file
5
db/migrate/20250312160915_user_latest_chat.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class UserLatestChat < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
add_reference :users, :current_chat, foreign_key: { to_table: :chats }, null: true, type: :uuid
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue