-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into upgrade-elastic-s…
…earch
- Loading branch information
Showing
93 changed files
with
280,807 additions
and
397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Coding Conventions for the Zeeguu API | ||
|
||
## SQLAlchemy Related | ||
- [Adding altered objects to sessions without committing](https://github.com/zeeguu/api/discussions/210) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
from zeeguu.core.content_retriever.parse_with_readability_server import ( | ||
download_and_parse, | ||
) | ||
from zeeguu.core.content_retriever.parse_with_readability_server import download_and_parse | ||
|
||
from zeeguu.api.app import create_app | ||
|
||
app = create_app() | ||
app.app_context().push() | ||
|
||
na = download_and_parse( | ||
"https://www.dr.dk/stories/1288510966/allerede-inden-oscar-showets-start-lurer-en-ny-skandale-i-kulissen" | ||
) | ||
"https://www.dr.dk/nyheder/indland/flere-laeger-uden-koebenhavn-kronikerpakker-og-kaempe-region-her-er-det-vigtigste-i") | ||
print(na) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
CREATE TABLE `zeeguu_test`.`user_cohort_map` ( | ||
`user_id` INT NOT NULL, | ||
`cohort_id` INT NOT NULL, | ||
PRIMARY KEY (`user_id`, `cohort_id`), | ||
INDEX `cohort_id_ibfk_1_idx` (`user_id` ASC) VISIBLE, | ||
CONSTRAINT `user_cohort_map_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `zeeguu_test`.`user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | ||
CONSTRAINT `user_cohort_map_ibfk_2` FOREIGN KEY (`cohort_id`) REFERENCES `zeeguu_test`.`cohort` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION | ||
); | ||
|
||
INSERT INTO | ||
user_cohort_map (user_id, cohort_id) | ||
SELECT | ||
id, | ||
cohort_id | ||
from | ||
user | ||
WHERE | ||
cohort_id is not null; | ||
|
||
ALTER TABLE | ||
`zeeguu_test`.`user` DROP FOREIGN KEY `user_ibfk_3`; | ||
|
||
ALTER TABLE | ||
`zeeguu_test`.`user` DROP COLUMN `cohort_id`, | ||
DROP INDEX `cohort_id`; | ||
|
||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
CREATE TABLE `zeeguu_test`.`feedback_component` ( | ||
`id` INT NOT NULL AUTO_INCREMENT, | ||
`component_type` VARCHAR(45) NOT NULL, | ||
PRIMARY KEY (`id`) | ||
); | ||
|
||
INSERT INTO | ||
`zeeguu_test`.`feedback_component` (`component_type`) | ||
VALUES | ||
('Article Reader'); | ||
|
||
INSERT INTO | ||
`zeeguu_test`.`feedback_component` (`component_type`) | ||
VALUES | ||
('Article Recommendations'); | ||
|
||
INSERT INTO | ||
`zeeguu_test`.`feedback_component` (`component_type`) | ||
VALUES | ||
('Translation'); | ||
|
||
INSERT INTO | ||
`zeeguu_test`.`feedback_component` (`component_type`) | ||
VALUES | ||
('Sound'); | ||
|
||
INSERT INTO | ||
`zeeguu_test`.`feedback_component` (`component_type`) | ||
VALUES | ||
('Exercises'); | ||
|
||
INSERT INTO | ||
`zeeguu_test`.`feedback_component` (`component_type`) | ||
VALUES | ||
('Extension'); | ||
|
||
INSERT INTO | ||
`zeeguu_test`.`feedback_component` (`component_type`) | ||
VALUES | ||
('Other'); | ||
|
||
CREATE TABLE `zeeguu_test`.`user_feedback` ( | ||
`id` INT NOT NULL AUTO_INCREMENT, | ||
`user_id` INT NOT NULL, | ||
`feedback_component_id` INT NOT NULL, | ||
`message` VARCHAR(512) NULL, | ||
`report_time` DATETIME NULL, | ||
`url_id` INT NULL, | ||
PRIMARY KEY (`id`), | ||
INDEX `user_feedback_ibfk_1_idx` (`user_id` ASC), | ||
INDEX `user_feedback_ibfk_2_idx` (`feedback_component_id` ASC), | ||
INDEX `user_feedback_ibfk_2_idx1` (`url_id` ASC), | ||
CONSTRAINT `user_feedback_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `zeeguu_test`.`user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | ||
CONSTRAINT `user_feedback_ibfk_2` FOREIGN KEY (`feedback_component_id`) REFERENCES `zeeguu_test`.`feedback_component` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | ||
CONSTRAINT `user_feedback_ibfk_3` FOREIGN KEY (`url_id`) REFERENCES `zeeguu_test`.`url` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
ALTER TABLE | ||
`zeeguu_test`.`search` | ||
ADD | ||
COLUMN `language_id` INT NULL | ||
AFTER | ||
`id`, | ||
CHANGE COLUMN `keywords` `keywords` VARCHAR(100) NULL DEFAULT NULL, | ||
ADD | ||
INDEX `search_ibfk_1_idx` (`language_id` ASC) VISIBLE; | ||
|
||
; | ||
|
||
ALTER TABLE | ||
`zeeguu_test`.`search` | ||
ADD | ||
CONSTRAINT `search_ibfk_1` FOREIGN KEY (`language_id`) REFERENCES `zeeguu_test`.`language` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | ||
|
||
UPDATE | ||
`zeeguu_test`.`search` s | ||
INNER JOIN `zeeguu_test`.`search_subscription` ssub ON s.id = ssub.search_id | ||
INNER JOIN `zeeguu_test`.`user` u on u.id = ssub.user_id | ||
SET | ||
s.language_id = u.learned_language_id; | ||
|
||
UPDATE | ||
`zeeguu_test`.`search` s | ||
INNER JOIN `zeeguu_test`.`search_filter` ssub ON s.id = ssub.search_id | ||
INNER JOIN `zeeguu_test`.`user` u on u.id = ssub.user_id | ||
SET | ||
s.language_id = u.learned_language_id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.