mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
units,lesson as standalone
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
'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');
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user