Add support for persistent copilot messages and threads

This commit is contained in:
Pranav
2025-05-12 17:47:20 -07:00
parent 543dd1476d
commit 9e8ea5d2f8
16 changed files with 276 additions and 2 deletions
@@ -0,0 +1,14 @@
class CreateCopilotThreads < ActiveRecord::Migration[7.0]
def change
create_table :copilot_threads do |t|
t.string :title, null: false
t.references :user, null: false, index: true
t.references :account, null: false, index: true
t.uuid :uuid, null: false, default: 'gen_random_uuid()'
t.timestamps
end
add_index :copilot_threads, :uuid, unique: true
end
end
@@ -0,0 +1,13 @@
class CreateCopilotMessages < ActiveRecord::Migration[7.0]
def change
create_table :copilot_messages do |t|
t.references :copilot_thread, null: false, index: true
t.references :user, null: false, index: true
t.references :account, null: false, index: true
t.string :message_type, null: false
t.jsonb :message, null: false, default: {}
t.timestamps
end
end
end