text: 'use strict';
  
  module.exports = {
      up: function(queryInterface, Sequelize) {
          /*
        Add altering commands here.
        Return a promise to correctly handle asynchronicity.
  
        Example:
        return queryInterface.createTable('users', { id: Sequelize.INTEGER });
      */
          return queryInterface.createTable('Subscriptions', {
              id: {
                  allowNull: false,
                  autoIncrement: true,
                  primaryKey: true,
                  type: Sequelize.INTEGER,
              },
              active: {
                  type: Sequelize.BOOLEAN,
                  allowNull: false,
                  default: true,
              },
              source: {
                  type: Sequelize.INTEGER,
                  allowNull: false,
                  references: {
                      model: 'Feed_Source',
                      key: 'id',
                  },
                  onUpdate: 'cascade',
                  onDelete: 'no action',
              },
              chatId: {
                  type: Sequelize.INTEGER,
                  allowNull: false,
              },
              createdAt: {
                  allowNull: false,
                  type: Sequelize.DATE,
              },
              updatedAt: {
                  allowNull: false,
                  type: Sequelize.DATE,
              },
          });
      },
  
      down: function(queryInterface, Sequelize) {
          /*
        Add reverting commands here.
        Return a promise to correctly handle asynchronicity.
  
        Example:
        return queryInterface.dropTable('users');
      */
          return queryInterface.dropTable('Subscriptions');
      },
  };
  