-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(verifybundle): ignore name-check for dashboard_widget * feat(coreapp): add coreApp-attribute to models and format * feat(coreapp): add coreApp to createApp-handler * feat(coreapp): add UI for coreApp * fix(apps): update core-filter to use core_app column * fix(appview): add core-app tag * fix(editApp): dont set coreApp to false if no manager * fix: fix core-app filter * fix(verifybundle): return manifest when no d2-config * fix: add core-app migration * refactor: check for bool instead of 2 ifs
- Loading branch information
Showing
21 changed files
with
229 additions
and
91 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
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
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,96 @@ | ||
exports.up = async function (knex) { | ||
await knex.schema.table('app', table => { | ||
table.boolean('core_app').defaultTo(false) | ||
}) | ||
await knex.raw('DROP VIEW apps_view') | ||
// update app-view with column | ||
await knex.raw(` | ||
CREATE VIEW apps_view AS | ||
SELECT app.id AS app_id, | ||
app.type, | ||
app.core_app, | ||
appver.version, appver.id AS version_id, appver.created_at AS version_created_at, appver.source_url, appver.demo_url, | ||
media.app_media_id AS media_id, media.original_filename, media.created_at AS media_created_at, media.media_type, | ||
localisedapp.language_code, localisedapp.name, localisedapp.description, localisedapp.slug AS appver_slug, | ||
s.status, s.created_at AS status_created_at, | ||
ac.min_dhis2_version, ac.max_dhis2_version, | ||
c.name AS channel_name, c.id AS channel_id, | ||
app.contact_email AS contact_email, | ||
users.id as owner_id, users.name as owner_name, users.email as owner_email, | ||
org.name AS organisation, org.slug AS organisation_slug, org.email as organisation_email | ||
FROM app | ||
INNER JOIN app_status AS s | ||
ON s.app_id = app.id | ||
INNER JOIN app_version AS appver | ||
ON appver.app_id = s.app_id | ||
LEFT JOIN app_media_view AS media | ||
ON media.app_id = s.app_id | ||
INNER JOIN app_version_localised AS localisedapp | ||
ON localisedapp.app_version_id = appver.id | ||
INNER JOIN app_channel AS ac | ||
ON ac.app_version_id = appver.id | ||
INNER JOIN channel AS c | ||
ON c.id = ac.channel_id | ||
INNER JOIN users | ||
ON users.id = app.created_by_user_id | ||
INNER JOIN organisation AS org | ||
ON org.id = app.organisation_id | ||
`) | ||
} | ||
|
||
exports.down = async function (knex) { | ||
await knex.raw('DROP VIEW apps_view') | ||
await knex.schema.table('app', table => { | ||
table.dropColumn('core_app') | ||
}) | ||
|
||
await knex.raw(` | ||
CREATE VIEW apps_view AS | ||
SELECT app.id AS app_id, | ||
app.type, | ||
appver.version, appver.id AS version_id, appver.created_at AS version_created_at, appver.source_url, appver.demo_url, | ||
media.app_media_id AS media_id, media.original_filename, media.created_at AS media_created_at, media.media_type, | ||
localisedapp.language_code, localisedapp.name, localisedapp.description, localisedapp.slug AS appver_slug, | ||
s.status, s.created_at AS status_created_at, | ||
ac.min_dhis2_version, ac.max_dhis2_version, | ||
c.name AS channel_name, c.id AS channel_id, | ||
app.contact_email AS contact_email, | ||
users.id as owner_id, users.name as owner_name, users.email as owner_email, | ||
org.name AS organisation, org.slug AS organisation_slug, org.email as organisation_email | ||
FROM app | ||
INNER JOIN app_status AS s | ||
ON s.app_id = app.id | ||
INNER JOIN app_version AS appver | ||
ON appver.app_id = s.app_id | ||
LEFT JOIN app_media_view AS media | ||
ON media.app_id = s.app_id | ||
INNER JOIN app_version_localised AS localisedapp | ||
ON localisedapp.app_version_id = appver.id | ||
INNER JOIN app_channel AS ac | ||
ON ac.app_version_id = appver.id | ||
INNER JOIN channel AS c | ||
ON c.id = ac.channel_id | ||
INNER JOIN users | ||
ON users.id = app.created_by_user_id | ||
INNER JOIN organisation AS org | ||
ON org.id = app.organisation_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
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.