@directus/api
Version:
Directus is a real-time API and App dashboard for managing SQL database content
41 lines (40 loc) • 1.43 kB
JavaScript
//#region src/database/migrations/20260211A-add-deployment-webhooks.ts
async function up(knex) {
await knex.schema.alterTable("directus_deployments", (table) => {
table.json("webhook_ids").nullable();
table.string("webhook_secret").nullable();
table.timestamp("last_synced_at").nullable();
});
await knex.schema.alterTable("directus_deployment_projects", (table) => {
table.string("url").nullable();
table.string("framework").nullable();
table.boolean("deployable").notNullable().defaultTo(true);
});
await knex.schema.alterTable("directus_deployment_runs", (table) => {
table.string("status").nullable();
table.string("url").nullable();
table.timestamp("started_at").nullable();
table.timestamp("completed_at").nullable();
});
await knex("directus_deployment_runs").delete();
}
async function down(knex) {
await knex.schema.alterTable("directus_deployment_runs", (table) => {
table.dropColumn("status");
table.dropColumn("url");
table.dropColumn("started_at");
table.dropColumn("completed_at");
});
await knex.schema.alterTable("directus_deployment_projects", (table) => {
table.dropColumn("url");
table.dropColumn("framework");
table.dropColumn("deployable");
});
await knex.schema.alterTable("directus_deployments", (table) => {
table.dropColumn("webhook_ids");
table.dropColumn("webhook_secret");
table.dropColumn("last_synced_at");
});
}
//#endregion
export { down, up };