// Which figures belong to which resource. // // The illustrations were queued as image jobs and shown on screen, but nothing // recorded that they belonged to the resource — so an exported deck had no way // to include them, and the pictures a person asked for lived only in the page // they were generated on. This is that missing link. // // Job ids rather than a join table: they are opaque uuids owned by the same // user, the ordering is the order the model asked for them, and there is no // second thing that needs to query them. exports.up = pgm => pgm.sql(` ALTER TABLE user_resources ADD COLUMN IF NOT EXISTS image_ids JSONB NOT NULL DEFAULT '[]'::jsonb; `); exports.down = pgm => pgm.sql(` ALTER TABLE user_resources DROP COLUMN IF EXISTS image_ids; `);