{"size": 750, "ext": "js", "max_stars_repo_path": "server/src/models/category.js", "max_stars_repo_name": "Wonjin-Jang/cashbook-12", "max_stars_repo_stars_event_min_datetime": "2021-07-28T00:40:23.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-28T00:40:23.000Z", "max_issues_repo_path": "server/src/models/category.js", "max_issues_repo_name": "Wonjin-Jang/cashbook-12", "max_issues_repo_issues_event_min_datetime": "2021-07-26T06:29:04.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-05T23:31:10.000Z", "max_forks_repo_path": "server/src/models/category.js", "max_forks_repo_name": "Wonjin-Jang/cashbook-12", "max_forks_repo_forks_event_min_datetime": "2021-08-06T04:01:32.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-14T13:02:09.000Z"}
{"max_stars_count": 1, "max_issues_count": 47, "max_forks_count": 6, "avg_line_length": 18.75, "max_line_length": 52, "alphanum_fraction": 0.5693333333}
import { DataTypes } from 'sequelize';
import sequelize from '../config/sequelize';

const Category = sequelize.define(
  'Category',
  {
    id: {
      type: DataTypes.INTEGER.UNSIGNED,
      autoIncrement: true,
      primaryKey: true,
    },
    name: {
      type: DataTypes.STRING(20),
      allowNull: false,
      unique: true,
    },
    value: {
      type: DataTypes.STRING(40),
      allowNull: false,
      unique: true,
    },
    color: {
      type: DataTypes.STRING(7),
      allowNull: false,
      unique: true,
    },
    type: {
      type: DataTypes.ENUM('income', 'expenditure'),
      allowNull: false,
    },
  },
  {
    tableName: 'category',
    underscored: true,
    timestamps: false,
  },
);

export default Category;
