@tanglemedia/directus-collection-flex-editor
Version:
Creates the flex table and some basic related nodes like image, resource, embed, and section
37 lines (35 loc) • 840 B
JavaScript
export async function up(knex) {
const collectionExists = await knex("directus_collections")
.where({
collection: "tngl_flex_content_nodes",
})
.first();
if (!!collectionExists) {
await knex("directus_collections")
.where({
collection: "tngl_flex_content_nodes",
})
.update({
translations: JSON.stringify([
{ language: "en-US", translation: "Flexible Content Component" },
{ language: "en-CA", translation: "Flexible Content Component" },
]),
});
}
}
export async function down(knex) {
const collectionExists = await knex("directus_collections")
.where({
collection: "tngl_flex_content_nodes",
})
.first();
if (!!collectionExists) {
await knex("directus_collections")
.where({
collection: "tngl_flex_content_nodes",
})
.update({
translations: null,
});
}
}