Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
1.1 kB
1
Indexable
Never
import { Model, QueryInterface, DataTypes } from 'sequelize';
import Matchs from '../../Interfaces/IMatchs';

export default {
  up(queryInterface: QueryInterface) {
    return queryInterface.createTable<Model>('matches', {
      id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        allowNull: false,
        autoIncrement: true,
      },
      home_team_id: {
        type: DataTypes.INTEGER,
        allowNull: false,
        field: 'home_team_id',
      },
      home_team_goals: {
        type: DataTypes.INTEGER,
        allowNull: false,
        field: 'home_team_goals',
      },
      away_team_id: {
        type: DataTypes.INTEGER,
        allowNull: false,
        field: 'away_team_id',
      },
      away_team_goals: {
        type: DataTypes.INTEGER,
        allowNull: false,
        field: 'away_team_goals',
      },
      in_progress: {
        type: DataTypes.BOOLEAN,
        allowNull: false,
        field: 'in_progress',
      },
    });
  },
  down(queryInterface: QueryInterface) {
    return queryInterface.dropTable('matches');
  },
};
Leave a Comment