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,31 @@
'use strict';
// The "Access Rules" feature (rule-based access on top of/instead of item-
// specific entitlement — course_subscription_access/required_active_tier/
// group_restriction/item_allowlist rule types, plus the "starter-set purchase
// eligibility" gate derived from item_allowlist) has been removed entirely,
// admin UI and runtime enforcement both — item-specific `user_tier_grants` is
// the only entitlement mechanism now (see hasItemGrant() in
// controllers/client/courses.controller.js). No other table has an FK into
// plan_policies (only plan_policies.plan_id -> tier_plans.plan_id), so this
// is a clean, isolated drop.
//
// NOT auto-run — do not execute against the shared dev/prod database without
// explicit confirmation.
module.exports = {
async up(queryInterface) {
await queryInterface.dropTable('plan_policies');
},
async down(queryInterface, Sequelize) {
await queryInterface.createTable('plan_policies', {
policy_id: { type: Sequelize.BIGINT, primaryKey: true, autoIncrement: true },
plan_id: { type: Sequelize.BIGINT, allowNull: false, unique: true,
references: { model: 'tier_plans', key: 'plan_id' },
onUpdate: 'CASCADE', onDelete: 'CASCADE' },
access_rules: { type: Sequelize.JSONB, allowNull: false, defaultValue: [] },
createdAt: { type: Sequelize.DATE, allowNull: false },
updatedAt: { type: Sequelize.DATE, allowNull: false },
});
},
};