Skip to content

Commit

Permalink
refactor(db): update schema
Browse files Browse the repository at this point in the history
  • Loading branch information
flosse committed Jan 18, 2018
1 parent b0c3967 commit e04ef9d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ CREATE TABLE entry_category_relations (
entry_version INTEGER NOT NULL,
category_id TEXT NOT NULL,
PRIMARY KEY (entry_id, entry_version, category_id),
FOREIGN KEY (entry_id, entry_version) REFERENCES entries(id,version)
-- FOREIGN KEY (category_id) REFERENCES categories(id)
FOREIGN KEY (entry_id, entry_version) REFERENCES entries(id,version),
FOREIGN KEY (category_id) REFERENCES categories(id)
);

CREATE TABLE entry_tag_relations (
Expand Down
5 changes: 5 additions & 0 deletions src/infrastructure/db/sqlite/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ table! {
}
}

joinable!(bbox_subscriptions -> users (username));
joinable!(comments -> ratings (rating_id));
joinable!(entry_category_relations -> categories (category_id));
joinable!(entry_tag_relations -> tags (tag_id));

allow_tables_to_appear_in_same_query!(
bbox_subscriptions,
categories,
Expand Down

0 comments on commit e04ef9d

Please sign in to comment.