mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
24 lines
800 B
JavaScript
24 lines
800 B
JavaScript
'use strict';
|
|
|
|
// Part 2B — standalone (non-course) units currently can never be tier-gated:
|
|
// canAccessUnit only ever checks course links, and an independent unit by
|
|
// definition has none. Add a direct, optional subscription field so a
|
|
// standalone unit can require a tier on its own. Deliberately no CHECK
|
|
// constraint — mirrors 20260101000065-drop-tier-enum-check-user-tiers.js's
|
|
// fix, since tier slugs are admin-defined (tier_categories.slug) and not a
|
|
// fixed enum.
|
|
|
|
module.exports = {
|
|
async up(queryInterface, Sequelize) {
|
|
await queryInterface.addColumn('units', 'subscription', {
|
|
type: Sequelize.STRING(50),
|
|
allowNull: true,
|
|
after: 'title',
|
|
});
|
|
},
|
|
|
|
async down(queryInterface) {
|
|
await queryInterface.removeColumn('units', 'subscription');
|
|
},
|
|
};
|