mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
assets and tier plans revamp
Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
/***********************************************************************************************************************************************************************
|
||||
* File Name: plan_lessons.mdl.js
|
||||
* Type of Program: Model
|
||||
* Description: Junction table — links standalone Lessons to a specific tier plan.
|
||||
* UNIQUE on lesson_id enforces one lesson belongs to one plan only.
|
||||
* Mirrors plan_courses.mdl.js — bundling/display only, not an
|
||||
* access-control mechanism (see canAccessLesson).
|
||||
* Author: Kenneth Obsequio (@lash0000)
|
||||
* Date Created: Aug. 1, 2026
|
||||
***********************************************************************************************************************************************************************/
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../../config/db.config');
|
||||
|
||||
const mdl_PlanLessons = sequelize.define('PlanLesson', {
|
||||
id: { type: DataTypes.BIGINT, primaryKey: true, autoIncrement: true },
|
||||
plan_id: { type: DataTypes.BIGINT, allowNull: false },
|
||||
lesson_id: { type: DataTypes.BIGINT, allowNull: false },
|
||||
}, {
|
||||
tableName: 'plan_lessons',
|
||||
timestamps: true,
|
||||
paranoid: false,
|
||||
});
|
||||
|
||||
module.exports = mdl_PlanLessons;
|
||||
Reference in New Issue
Block a user