mirror of
https://github.com/outline/outline.git
synced 2026-06-30 03:34:24 +03:00
1749ffe20d
* Migration * Store previous subdomains * Redirect previous subdomains at service layer * refactor * refactor * change index * Guard logic to hosted only
28 lines
880 B
JavaScript
28 lines
880 B
JavaScript
"use strict";
|
|
|
|
/** @type {import('sequelize-cli').Migration} */
|
|
module.exports = {
|
|
async up(queryInterface, Sequelize) {
|
|
await queryInterface.sequelize.transaction(async transaction => {
|
|
await queryInterface.addColumn("teams", "previousSubdomains", {
|
|
type: Sequelize.ARRAY(Sequelize.STRING),
|
|
allowNull: true,
|
|
}, { transaction });
|
|
await queryInterface.sequelize.query(
|
|
`CREATE INDEX teams_previous_subdomains ON teams USING GIN ("previousSubdomains");`,
|
|
{ transaction }
|
|
);
|
|
});
|
|
},
|
|
|
|
async down(queryInterface) {
|
|
await queryInterface.sequelize.transaction(async transaction => {
|
|
await queryInterface.sequelize.query(
|
|
`DROP INDEX teams_previous_subdomains;`,
|
|
{ transaction }
|
|
);
|
|
await queryInterface.removeColumn("teams", "previousSubdomains", { transaction });
|
|
});
|
|
},
|
|
};
|