StMarkSchoolApplication / app / DB_schema / course_enrollment_table.js
course_enrollment_table.js
Raw
module.exports = (sequelize, Sequelize) => {
    const Course_Enrolment = sequelize.define('course_enrolment', {
        id: {
            type: Sequelize.INTEGER,
            autoIncrement: true,
            primaryKey: true
        },
        user_id: {
            type: Sequelize.INTEGER,
            allowNull: false
        },
        course_id: {
            type: Sequelize.INTEGER,
            allowNull: false
        },
        createdAt: {
            type: Sequelize.DATE,
            allowNull: false,
            defaultValue: Sequelize.literal("NOW()")
        },
        current_grade: {
            type: Sequelize.INTEGER,
            allowNull: false
        }
    });

    return Course_Enrolment;
}