{"size": 427, "ext": "js", "max_stars_repo_path": "src/app/models/Task.js", "max_stars_repo_name": "lunebakami/projects-api", "max_stars_repo_stars_event_min_datetime": "2019-12-31T13:04:43.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-31T13:55:51.000Z", "max_issues_repo_path": "src/app/models/Task.js", "max_issues_repo_name": "lunebakami/test-deploy-heroku", "max_issues_repo_issues_event_min_datetime": "2021-05-10T22:55:10.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-10T22:55:10.000Z", "max_forks_repo_path": "src/app/models/Task.js", "max_forks_repo_name": "lunebakami/test-deploy-heroku", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 15.8148148148, "max_line_length": 45, "alphanum_fraction": 0.5644028103}
import Sequelize, { Model } from 'sequelize';

class Task extends Model {
  static init(sequelize) {
    super.init(
      {
        title: Sequelize.STRING,
        description: Sequelize.STRING,
      },
      {
        sequelize,
      }
    );

    return this;
  }

  static associate(models) {
    this.belongsTo(models.Project, {
      foreign_key: 'project_id',
      as: 'project',
    });
  }
}

export default Task;
