New.js 710 B

123456789101112131415161718192021222324252627
  1. module.exports = ( app ) => {
  2. this.conn = new require('../bin/mysql').mysqlConn();
  3. // this.conn = new app.bin.mysql.mysqlConn;
  4. const New = this.conn.define('news', {
  5. // id: {
  6. // type: this.conn.Sequelize.INTEGER,
  7. // primaryKey: true,
  8. // autoIncrement: true,
  9. // },
  10. websiteSlug: this.conn.Sequelize.STRING,
  11. link: this.conn.Sequelize.STRING,
  12. thumb: this.conn.Sequelize.STRING,
  13. title: this.conn.Sequelize.STRING,
  14. date: this.conn.Sequelize.STRING,
  15. content: this.conn.Sequelize.TEXT,
  16. tag: this.conn.Sequelize.STRING,
  17. // createdAt: this.conn.Sequelize.DATE,
  18. // updatedAt: this.conn.Sequelize.DATE,
  19. });
  20. this.query = New;
  21. return this;
  22. }