Skip to content

Commit

Permalink
migration fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
e11sy committed Jul 20, 2024
1 parent a2f589d commit e91696b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions migrations/tenant/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ ALTER TABLE public.note_history
--
-- Name: note_history user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codex
--
ALTER TABLE public.note_history DROP CONSTRAINT IF EXISTS user_id_fkey;
ALTER TABLE public.note_history DROP CONSTRAINT IF EXISTS useeeer_id_fkey;
ALTER TABLE public.note_history
ADD CONSTRAINT user_id_fkey FOREIGN KEY (note_id) REFERENCES public.users(id)
ADD CONSTRAINT useeeer_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id)
ON UPDATE CASCADE ON DELETE CASCADE;

CREATE UNIQUE INDEX note_history_note_id_idx ON public.note_history (note_id);
2 changes: 1 addition & 1 deletion src/repository/storage/postgres/orm/sequelize/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default class UserSequelizeStorage {
this.historyModel = model;

this.model.hasMany(this.historyModel, {
foreignKey: 'noteId',
foreignKey: 'userId',
as: 'noteHistory',
});
}
Expand Down

0 comments on commit e91696b

Please sign in to comment.