mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
22 lines
1.1 KiB
JavaScript
22 lines
1.1 KiB
JavaScript
/***********************************************************************************************************************************************************************
|
|
* File Name: plan_courses.mdl.js
|
|
* Type of Program: Model
|
|
* Description: Junction table — links courses to a specific tier plan.
|
|
* UNIQUE on course_id enforces one course belongs to one plan only.
|
|
* Author: Kenneth Obsequio (@lash0000)
|
|
* Date Created: Jun. 6, 2026
|
|
***********************************************************************************************************************************************************************/
|
|
const { DataTypes } = require('sequelize');
|
|
const sequelize = require('../../config/db.config');
|
|
|
|
const mdl_PlanCourses = sequelize.define('PlanCourse', {
|
|
id: { type: DataTypes.BIGINT, primaryKey: true, autoIncrement: true },
|
|
plan_id: { type: DataTypes.BIGINT, allowNull: false },
|
|
course_id: { type: DataTypes.BIGINT, allowNull: false },
|
|
}, {
|
|
tableName: 'plan_courses',
|
|
timestamps: true,
|
|
paranoid: false,
|
|
});
|
|
|
|
module.exports = mdl_PlanCourses; |