Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/user favorite tags #266

Merged
merged 5 commits into from
Jan 31, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add favorite tags for users
  • Loading branch information
chadweimer committed Jan 31, 2021
commit ddec9d9f82622330a2010297ba959a11bf375be4
5 changes: 5 additions & 0 deletions db/migrations/postgres/0019_user_favorite_tags.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BEGIN;

DROP TABLE app_user_favorite_tag;

COMMIT;
11 changes: 11 additions & 0 deletions db/migrations/postgres/0019_user_favorite_tags.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
BEGIN;

CREATE TABLE app_user_favorite_tag (
user_id INTEGER NOT NULL,
tag TEXT NOT NULL,
FOREIGN KEY(user_id) REFERENCES app_user(id) ON DELETE CASCADE
);
CREATE INDEX app_user_favorite_tag_idx ON app_user_favorite_tag(tag);
CREATE INDEX app_user_favorite_tag_user_id_idx ON app_user_favorite_tag(user_id);

COMMIT;
1 change: 1 addition & 0 deletions db/migrations/sqlite3/0005_user_favorite_tags.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE app_user_favorite_tag;
7 changes: 7 additions & 0 deletions db/migrations/sqlite3/0005_user_favorite_tags.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TABLE app_user_favorite_tag (
user_id INTEGER NOT NULL,
tag TEXT NOT NULL,
FOREIGN KEY(user_id) REFERENCES app_user(id) ON DELETE CASCADE
);
CREATE INDEX app_user_favorite_tag_idx ON app_user_favorite_tag(tag);
CREATE INDEX app_user_favorite_tag_user_id_idx ON app_user_favorite_tag(user_id);