Added description, user_id, user_ip columns to notes
Added migration for adding new columns (description, user_id, user_ip) to notes table. Also, migration adds foreign key connecting notes and users tables (using user_id column).
This commit is contained in:
parent
5d76ec051e
commit
16bdcac6d7
3 changed files with 37 additions and 9 deletions
9
db/migrate/20250104140952_add_description_to_notes.rb
Normal file
9
db/migrate/20250104140952_add_description_to_notes.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
class AddDescriptionToNotes < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
add_column :notes, :description, :text, :null => false, :default => ""
|
||||
add_column :notes, :user_id, :bigint
|
||||
add_column :notes, :user_ip, :inet
|
||||
|
||||
add_foreign_key :notes, :users, :column => :user_id, :name => "notes_user_id_fkey", :validate => false
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue