Files
outline/server/migrations/20220127000000-index-fixes.js
codegen-sh[bot] 97f8d0f265 Separate Prettier and ESLint according to best practices (#9565)
* 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>
2025-07-08 18:01:48 -04:00

57 lines
2.0 KiB
JavaScript

"use strict";
module.exports = {
up: async (queryInterface) => {
await queryInterface.addIndex("views", ["lastEditingAt"], {
name: "views_last_editing_at",
});
await queryInterface.addIndex("pins", ["teamId"], {
name: "pins_team_id",
});
await queryInterface.addIndex("collections", ["teamId", "deletedAt"], {
name: "collections_team_id_deleted_at",
});
await queryInterface.addIndex("stars", ["userId", "documentId"], {
name: "stars_user_id_document_id",
});
await queryInterface.addIndex("documents", ["collectionId"], {
name: "documents_collection_id",
});
await queryInterface.addIndex("documents", ["publishedAt"], {
name: "documents_published_at",
});
await queryInterface.addIndex("documents", ["teamId", "deletedAt"], {
name: "documents_team_id",
});
// somehow these indexes were being used sometimes, but i'll never know how.
// Note: These are not recreated in the down method
await queryInterface.removeIndex(
"documents",
"documents_id_atlas_id_published_at"
);
await queryInterface.removeIndex(
"documents",
"documents_id_team_id_deleted_at"
);
await queryInterface.removeIndex("documents", "documents_id_deleted_at");
await queryInterface.removeIndex("collections", "atlases_id_deleted_at");
await queryInterface.removeIndex(
"collections",
"atlases_id_team_id_deleted_at"
);
},
down: async (queryInterface) => {
await queryInterface.removeIndex("views", "views_last_editing_at");
await queryInterface.removeIndex("pins", "pins_team_id");
await queryInterface.removeIndex(
"collections",
"collections_team_id_deleted_at"
);
await queryInterface.removeIndex("stars", "stars_user_id_document_id");
await queryInterface.removeIndex("documents", "documents_collection_id");
await queryInterface.removeIndex("documents", "documents_published_at");
await queryInterface.removeIndex("documents", "documents_team_id");
},
};