const { empty } = require("../Helpers/Common");
const sequelize = require("../config/dbconnection");
const Sequelize = require('sequelize')

const CustomFields = sequelize.define('custom_fields', {
    id: { type: Sequelize.INTEGER, allowNull: false, primaryKey: true, autoIncrement: true },
    name: { type: Sequelize.STRING, allowNull: false },
    template_id:{type:Sequelize.INTEGER,allowNull:false,defaultValue:false},
    html_tag:{type:Sequelize.CHAR,allowNull:false,defaultValue:false},
    input_type:{type:Sequelize.CHAR,allowNull:false,defaultValue:false},
    is_required:{type:Sequelize.TINYINT,allowNull:false,defaultValue:0},
    placeholder:{type:Sequelize.CHAR,allowNull:true,defaultValue:false},
    help_text:{type:Sequelize.TEXT,allowNull:true},
    date_format:{type:Sequelize.CHAR,allowNull:true,defaultValue:null},
    pattern:{type:Sequelize.CHAR,allowNull:true,defaultValue:null},
    content:{type:Sequelize.TEXT,allowNull:true,defaultValue:null},
    default_select:{type:Sequelize.CHAR,allowNull:true,defaultValue:null},
    a_href:{type:Sequelize.TEXT,allowNull:true,},
    a_target:{type:Sequelize.TINYINT,allowNull:true,defaultValue:0},
    row_id:{type:Sequelize.CHAR,allowNull:true,defaultValue:null},
    column_id:{type:Sequelize.CHAR,allowNull:true,defaultValue:null},
    field_uid:{type:Sequelize.CHAR,allowNull:true,defaultValue:null},
    tag_uid:{type:Sequelize.CHAR,allowNull:true,defaultValue:null},
    position_order:{type:Sequelize.TINYINT,allowNull:false,defaultValue:0},
    added_by:{type:Sequelize.INTEGER,allowNull:false,defaultValue:false},
    timestamp:{type:Sequelize.INTEGER,allowNull:false,defaultValue:false},
    status:{type:Sequelize.TINYINT,allowNull:false,defaultValue:1}
},{timestamps:false})



