Skip to content

Commit

Permalink
Enable Admire Token pt1 (#1160)
Browse files Browse the repository at this point in the history
* base

* generate working

* gen still working

* test failing

* added resolver

* also needed

* some req changes

* minor

* rename

* migration fix

* lint

* cleanup

* cleanup

* more cleanup

* remove comments
  • Loading branch information
Rohan-cp authored Aug 23, 2023
1 parent 5925e32 commit f4b2d16
Show file tree
Hide file tree
Showing 17 changed files with 947 additions and 18 deletions.
4 changes: 3 additions & 1 deletion db/gen/coredb/admire.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 12 additions & 6 deletions db/gen/coredb/batch.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions db/gen/coredb/models_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions db/gen/coredb/query.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions db/migrations/core/000105_admire_token.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE admires ADD COLUMN IF NOT EXISTS token_id varchar(255) references tokens(id);
CREATE UNIQUE index admire_actor_id_token_id_idx ON admires(actor_id, token_id) WHERE deleted = false;
4 changes: 2 additions & 2 deletions db/queries/core/admire.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- name: CreateAdmire :one
insert into admires (id, feed_event_id, post_id, actor_id) values ($1, sqlc.narg('feed_event'), sqlc.narg('post'), $2) returning id;
insert into admires (id, feed_event_id, post_id, token_id, actor_id) values ($1, sqlc.narg('feed_event'), sqlc.narg('post'), sqlc.narg('token'), $2) returning id;

-- name: DeleteAdmireByID :exec
update admires set deleted = true where id = $1;
update admires set deleted = true where id = $1;
Loading

0 comments on commit f4b2d16

Please sign in to comment.