Skip to content

Commit

Permalink
Adds OldNote model file
Browse files Browse the repository at this point in the history
Adds OldNote model file for modeling one row of old_notes table. Also, added author association for connecting with users table.
  • Loading branch information
nenad-vujicic committed Jan 31, 2025
1 parent 96657ab commit 8f390a2
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions app/models/old_note.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# == Schema Information
#
# Table name: old_notes
#
# note_id :bigint(8) not null, primary key
# latitude :integer not null
# longitude :integer not null
# tile :bigint(8) not null
# timestamp :datetime not null
# status :enum not null
# description :text default(""), not null
# user_id :bigint(8)
# user_ip :inet
# version :bigint(8) default(1), not null, primary key
#
# Indexes
#
# index_old_notes_on_version (version)
#
# Foreign Keys
#
# old_notes_note_id_fkey (note_id => notes.id)
# old_notes_user_id_fkey (user_id => users.id)
#

class OldNote < ApplicationRecord
belongs_to :author, :class_name => "User", :foreign_key => "user_id", :optional => true
end

0 comments on commit 8f390a2

Please sign in to comment.