mirror of
https://github.com/outline/outline.git
synced 2026-06-27 10:14:23 +03:00
c5cd4d9335
* fix: Remove nullable on teams.name column * Add test
24 lines
605 B
JavaScript
24 lines
605 B
JavaScript
"use strict";
|
|
|
|
/** @type {import('sequelize-cli').Migration} */
|
|
module.exports = {
|
|
async up(queryInterface, Sequelize) {
|
|
// Update any NULL team names to "Wiki" before removing nullable constraint
|
|
await queryInterface.sequelize.query(
|
|
`UPDATE teams SET name = 'Wiki' WHERE name IS NULL;`
|
|
);
|
|
|
|
await queryInterface.changeColumn("teams", "name", {
|
|
type: Sequelize.STRING,
|
|
allowNull: false,
|
|
});
|
|
},
|
|
|
|
async down(queryInterface, Sequelize) {
|
|
await queryInterface.changeColumn("teams", "name", {
|
|
type: Sequelize.STRING,
|
|
allowNull: true,
|
|
});
|
|
},
|
|
};
|