chore: relocate backend into apps/api ahead of monorepo merge

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-24 12:20:40 +08:00
co-authored by Claude Sonnet 5
parent af44598df6
commit eaa6d2276a
388 changed files with 0 additions and 13998 deletions
@@ -0,0 +1,43 @@
'use strict';
// Tracks background container-remux jobs for video assets uploaded as .mov/
// .mkv — those formats often load slowly in-browser (moov/Cues index at the
// end of the file) compared to faststart .mp4. See services/ffmpeg.service.js
// + services/assetTranscode.service.js.
//
// STRING + explicit CHECK instead of a real ENUM — same CockroachDB
// constraint noted in 20270101000032-create-advertisements.js (addColumn
// can't create a new enum type the way createTable can).
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn('assets', 'transcode_status', {
type: Sequelize.STRING(20),
allowNull: false,
defaultValue: 'none',
});
await queryInterface.addColumn('assets', 'transcode_error', {
type: Sequelize.TEXT,
allowNull: true,
});
await queryInterface.addConstraint('assets', {
fields: ['transcode_status'],
type: 'check',
name: 'check_assets_transcode_status',
where: { transcode_status: { [Sequelize.Op.in]: ['none', 'pending', 'processing', 'done', 'failed'] } },
});
await queryInterface.sequelize.query(`
CREATE INDEX idx_assets_transcode_status
ON assets (transcode_status)
WHERE transcode_status IN ('pending', 'processing');
`);
},
async down(queryInterface) {
await queryInterface.removeConstraint('assets', 'check_assets_transcode_status');
await queryInterface.removeColumn('assets', 'transcode_status');
await queryInterface.removeColumn('assets', 'transcode_error');
},
};