'use strict'; /** * Adds connected-appliance columns to the license_state singleton table. * * appliance_id — stable install id generated by the appliance on first boot * check_in_url — URL the daily refresh poller calls (from ~/alga-license /register) * appliance_credential — per-appliance bearer credential (for check-in), stored as * a SHA-256 hex hash so the plaintext never hits the DB. * last_checkin_at — display-only; timestamp of the last successful check-in */ exports.up = async function (knex) { await knex.schema.alterTable('license_state', (table) => { table.text('appliance_id').nullable(); table.text('check_in_url').nullable(); table.text('appliance_credential').nullable(); table.timestamp('last_checkin_at', { useTz: true }).nullable(); }); }; exports.down = async function (knex) { await knex.schema.alterTable('license_state', (table) => { table.dropColumn('appliance_id'); table.dropColumn('check_in_url'); table.dropColumn('appliance_credential'); table.dropColumn('last_checkin_at'); }); };