Class: MessageMigration

Inherits:
Object
  • Object
show all
Defined in:
lib/chatgpt_assistant/migrations.rb

Overview

Message model

Instance Method Summary collapse

Instance Method Details

#changeObject



68
69
70
71
72
73
74
75
76
77
# File 'lib/chatgpt_assistant/migrations.rb', line 68

def change
  return if ActiveRecord::Base.connection.table_exists? :messages

  create_table :messages do |t|
    t.references :chat, null: false, foreign_key: true
    t.integer :role, null: false, default: 0
    t.text :content, null: false, default: ""
    t.timestamps
  end
end