mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
97f8d0f265
* Separate Prettier and ESLint according to best practices - Create standalone .prettierrc configuration file - Remove eslint-plugin-prettier integration from ESLint config - Replace with eslint-config-prettier to disable conflicting rules - Remove eslint-plugin-prettier dependency - Add dedicated format and format:check scripts - Update lint-staged to run Prettier and ESLint separately - Format entire codebase with new Prettier configuration This follows the recommended approach from Prettier documentation: https://prettier.io/docs/integrating-with-linters#notes * Remove test comment --------- Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
"use strict";
|
|
|
|
module.exports = {
|
|
async up(queryInterface) {
|
|
await queryInterface.sequelize.transaction(async (transaction) => {
|
|
await queryInterface.removeColumn("users", "isAdmin", { transaction });
|
|
await queryInterface.removeColumn("users", "isViewer", { transaction });
|
|
});
|
|
},
|
|
|
|
async down(queryInterface, Sequelize) {
|
|
await queryInterface.sequelize.transaction(async (transaction) => {
|
|
await queryInterface.addColumn("users", "isAdmin", {
|
|
type: Sequelize.BOOLEAN,
|
|
allowNull: false,
|
|
defaultValue: false,
|
|
});
|
|
await queryInterface.addColumn("users", "isViewer", {
|
|
type: Sequelize.BOOLEAN,
|
|
allowNull: false,
|
|
defaultValue: false,
|
|
});
|
|
});
|
|
|
|
await queryInterface.sequelize.transaction(async (transaction) => {
|
|
await queryInterface.sequelize.query(
|
|
`UPDATE users SET "isAdmin" = true WHERE role = 'admin'`,
|
|
{
|
|
transaction,
|
|
type: Sequelize.QueryTypes.UPDATE,
|
|
}
|
|
);
|
|
await queryInterface.sequelize.query(
|
|
`UPDATE users SET "isViewer" = true WHERE role = 'viewer'`,
|
|
{
|
|
transaction,
|
|
type: Sequelize.QueryTypes.UPDATE,
|
|
}
|
|
);
|
|
});
|
|
},
|
|
};
|