u
This commit is contained in:
@@ -21,15 +21,15 @@ export default function setOffAll(provider) {
|
||||
? SQLITE_LIST_CATEGORY_IDS
|
||||
: MSSQL_LIST_CATEGORY_IDS;
|
||||
|
||||
const addCategoryTombstonesSql = `
|
||||
INSERT INTO posterminaltombstone (posterminal_id, entity_type, entity_id)
|
||||
const addCategoryObituariesSql = `
|
||||
INSERT INTO posterminalobituary (posterminal_id, entity_type, entity_id)
|
||||
SELECT posterminal_id, 'category', category_id
|
||||
FROM posterminalcategory
|
||||
WHERE posterminal_id = @posterminalId
|
||||
`;
|
||||
|
||||
const addArticleTombstonesSql = `
|
||||
INSERT INTO posterminaltombstone (posterminal_id, entity_type, entity_id)
|
||||
const addArticleObituariesSql = `
|
||||
INSERT INTO posterminalobituary (posterminal_id, entity_type, entity_id)
|
||||
SELECT DISTINCT pc.posterminal_id, 'article', ca.article_id
|
||||
FROM posterminalcategory pc
|
||||
INNER JOIN categoryarticle ca ON ca.category_id = pc.category_id
|
||||
@@ -64,8 +64,8 @@ export default function setOffAll(provider) {
|
||||
throw new Error('Posterminal not found');
|
||||
}
|
||||
|
||||
await runner.query(addCategoryTombstonesSql, { posterminalId });
|
||||
await runner.query(addArticleTombstonesSql, { posterminalId });
|
||||
await runner.query(addCategoryObituariesSql, { posterminalId });
|
||||
await runner.query(addArticleObituariesSql, { posterminalId });
|
||||
|
||||
await runner.query(setOffAllSql, { posterminalId });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user