TooAngel/democratic-collaboration

View on GitHub
migrations/20230108151108-create-repository.cjs

Summary

Maintainability
Test Coverage
'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.createTable('Repositories', {
      id: {
        type: Sequelize.UUID,
        defaultValue: Sequelize.UUIDV4,
        allowNull: false,
        primaryKey: true,
      },
      owner: {
        type: Sequelize.STRING
      },
      repo: {
        type: Sequelize.STRING
      },
      configured: {
        type: Sequelize.BOOLEAN
      },
      userId: {
        type: Sequelize.UUID,
      },
      createdAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      updatedAt: {
        allowNull: false,
        type: Sequelize.DATE
      }
    });
  },
  async down(queryInterface, Sequelize) {
    await queryInterface.dropTable('Repositories');
  }
};