Skip to content

Commit

Permalink
Add a primary key to the changeset_tags table
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Oct 7, 2023
1 parent 7dbc349 commit 1524466
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddPrimaryKeyToChangesetTags < ActiveRecord::Migration[7.0]
def change
add_primary_key :changeset_tags, [:changeset_id, :k]
remove_index :changeset_tags, [:changeset_id]
end
end
15 changes: 8 additions & 7 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1838,6 +1838,14 @@ ALTER TABLE ONLY public.changeset_comments
ADD CONSTRAINT changeset_comments_pkey PRIMARY KEY (id);


--
-- Name: changeset_tags changeset_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.changeset_tags
ADD CONSTRAINT changeset_tags_pkey PRIMARY KEY (changeset_id, k);


--
-- Name: changesets changesets_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -2205,13 +2213,6 @@ ALTER TABLE ONLY public.ways
CREATE INDEX acls_k_idx ON public.acls USING btree (k);


--
-- Name: changeset_tags_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX changeset_tags_id_idx ON public.changeset_tags USING btree (changeset_id);


--
-- Name: changesets_bbox_idx; Type: INDEX; Schema: public; Owner: -
--
Expand Down

0 comments on commit 1524466

Please sign in to comment.