"use strict";

module.exports = function(sequelize, DataTypes) {
  var PageChart =  sequelize.define('PageChart', {
	id: {type: DataTypes.STRING, unique: false, autoIncrement: true, primaryKey: true},
	idPage: DataTypes.INTEGER,
	idChart: DataTypes.INTEGER
  }, {
    classMethods: {
      associate: function(models) {
        PageChart.belongsTo(models.Page, {foreignKey: 'idPage'});
        PageChart.belongsTo(models.Chart, {foreignKey: 'idChart'});
      }
    }
  });

  return PageChart;
};