1
0
Fork 0
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:
Zach Gollwitzer 2025-03-12 12:39:16 -04:00
parent dd75cadebc
commit d1b83541c1
23 changed files with 231 additions and 1 deletions

View 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

View 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

View 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