// Illustration for a person's own resources. // // A third image workflow rather than a reuse of learning_hub, because the two // have opposite visibility rules. A learning_hub asset can be linked into // published content and served to everyone; generated_image_links enforces // that by requiring workflow='learning_hub', which is exactly the guarantee // this feature needs to keep. Filing a private illustration under learning_hub // would make it linkable into published content by anyone who knew its id. // // Nothing else is needed to serve them: asset() already grants the owner, so a // my_resources image is visible to the person who made it and to nobody else. exports.up = pgm => pgm.sql(` ALTER TABLE generated_image_jobs DROP CONSTRAINT IF EXISTS generated_image_jobs_workflow_check; ALTER TABLE generated_image_jobs ADD CONSTRAINT generated_image_jobs_workflow_check CHECK (workflow IN ('clinical_assistant', 'learning_hub', 'my_resources')); `); exports.down = pgm => pgm.sql(` DELETE FROM generated_image_jobs WHERE workflow='my_resources'; ALTER TABLE generated_image_jobs DROP CONSTRAINT IF EXISTS generated_image_jobs_workflow_check; ALTER TABLE generated_image_jobs ADD CONSTRAINT generated_image_jobs_workflow_check CHECK (workflow IN ('clinical_assistant', 'learning_hub')); `);