Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/pull/5499'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Jan 16, 2025
2 parents 283e7b9 + 16bdcac commit 0ab8d95
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
23 changes: 15 additions & 8 deletions app/models/note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,28 @@
#
# Table name: notes
#
# id :bigint(8) not null, primary key
# latitude :integer not null
# longitude :integer not null
# tile :bigint(8) not null
# updated_at :datetime not null
# created_at :datetime not null
# status :enum not null
# closed_at :datetime
# id :bigint(8) not null, primary key
# latitude :integer not null
# longitude :integer not null
# tile :bigint(8) not null
# updated_at :datetime not null
# created_at :datetime not null
# status :enum not null
# closed_at :datetime
# description :text default(""), not null
# user_id :bigint(8)
# user_ip :inet
#
# Indexes
#
# notes_created_at_idx (created_at)
# notes_tile_status_idx (tile,status)
# notes_updated_at_idx (updated_at)
#
# Foreign Keys
#
# notes_user_id_fkey (user_id => users.id)
#

class Note < ApplicationRecord
include GeoRecord
Expand Down
9 changes: 9 additions & 0 deletions db/migrate/20250104140952_add_description_to_notes.rb
Original file line number Diff line number Diff line change
@@ -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
14 changes: 13 additions & 1 deletion db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,10 @@ CREATE TABLE public.notes (
updated_at timestamp without time zone NOT NULL,
created_at timestamp without time zone NOT NULL,
status public.note_status_enum NOT NULL,
closed_at timestamp without time zone
closed_at timestamp without time zone,
description text DEFAULT ''::text NOT NULL,
user_id bigint,
user_ip inet
);


Expand Down Expand Up @@ -3210,6 +3213,14 @@ ALTER TABLE ONLY public.note_comments
ADD CONSTRAINT note_comments_note_id_fkey FOREIGN KEY (note_id) REFERENCES public.notes(id);


--
-- Name: notes notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.notes
ADD CONSTRAINT notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) NOT VALID;


--
-- Name: redactions redactions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -3397,6 +3408,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('23'),
('22'),
('21'),
('20250104140952'),
('20241023004427'),
('20241022141247'),
('20240913171951'),
Expand Down

0 comments on commit 0ab8d95

Please sign in to comment.