diff --git a/.babelrc b/.babelrc index 7fb6d8caf2..6106a126d2 100644 --- a/.babelrc +++ b/.babelrc @@ -21,10 +21,7 @@ [ "transform-inline-environment-variables", { - "include": [ - "SOURCE_COMMIT", - "SOURCE_VERSION" - ] + "include": ["SOURCE_COMMIT", "SOURCE_VERSION"] } ], "tsconfig-paths-module-resolver" @@ -39,16 +36,10 @@ } ] ], - "ignore": [ - "**/__mocks__", - "**/*.test.ts" - ] + "ignore": ["**/__mocks__", "**/*.test.ts"] }, "development": { - "ignore": [ - "**/__mocks__", - "**/*.test.ts" - ] + "ignore": ["**/__mocks__", "**/*.test.ts"] }, "test": { "presets": [ @@ -65,4 +56,4 @@ ] } } -} \ No newline at end of file +} diff --git a/.eslintrc b/.eslintrc index 730b9d6ee4..2cdd39531f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -15,7 +15,7 @@ "plugin:@typescript-eslint/recommended", "plugin:import/recommended", "plugin:import/typescript", - "plugin:prettier/recommended" + "prettier" ], "plugins": [ "es", @@ -162,13 +162,6 @@ } ] } - ], - "prettier/prettier": [ - "error", - { - "printWidth": 80, - "trailingComma": "es5" - } ] }, "settings": { diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index df6229ed37..eedb16f646 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -2,62 +2,62 @@ name: Bug report description: File a bug to help us improve labels: ["bug"] body: -- type: checkboxes - attributes: - label: Is there an existing issue for this? - description: Please search to see if an issue already exists for the bug you encountered. - options: - - label: I have searched the existing issues - required: true -- type: checkboxes - attributes: - label: This is not related to configuring Outline - description: I understand that questions related to configuring self-hosted Outline should be asked in the [community forum](https://github.com/outline/outline/discussions/categories/self-hosting). - options: - - label: The issue is not related to self-hosting config - required: true -- type: textarea - attributes: - label: Current Behavior - description: A concise description of what you're experiencing. - validations: - required: false -- type: textarea - attributes: - label: Expected Behavior - description: A concise description of what you expected to happen. - validations: - required: false -- type: textarea - attributes: - label: Steps To Reproduce - description: Steps to reproduce the behavior. - placeholder: | - 1. In this environment... - 1. With this config... - 1. Run '...' - 1. See error... - validations: - required: false -- type: textarea - attributes: - label: Environment - description: | - examples: - - **Outline**: Outline 0.80.0 - - **Browser**: Safari - value: | + - type: checkboxes + attributes: + label: Is there an existing issue for this? + description: Please search to see if an issue already exists for the bug you encountered. + options: + - label: I have searched the existing issues + required: true + - type: checkboxes + attributes: + label: This is not related to configuring Outline + description: I understand that questions related to configuring self-hosted Outline should be asked in the [community forum](https://github.com/outline/outline/discussions/categories/self-hosting). + options: + - label: The issue is not related to self-hosting config + required: true + - type: textarea + attributes: + label: Current Behavior + description: A concise description of what you're experiencing. + validations: + required: false + - type: textarea + attributes: + label: Expected Behavior + description: A concise description of what you expected to happen. + validations: + required: false + - type: textarea + attributes: + label: Steps To Reproduce + description: Steps to reproduce the behavior. + placeholder: | + 1. In this environment... + 1. With this config... + 1. Run '...' + 1. See error... + validations: + required: false + - type: textarea + attributes: + label: Environment + description: | + examples: + - **Outline**: Outline 0.80.0 + - **Browser**: Safari + value: | - Outline: - Browser: - render: markdown - validations: - required: false -- type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about the issue you are encountering! + render: markdown + validations: + required: false + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about the issue you are encountering! - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false diff --git a/.github/auto_assign.yml b/.github/auto_assign.yml index 7d63dda82a..d1bba1ba5d 100644 --- a/.github/auto_assign.yml +++ b/.github/auto_assign.yml @@ -2,9 +2,9 @@ addReviewers: true # A list of reviewers to be added to pull requests (GitHub user name) -reviewers: +reviewers: - tommoor -# A list of keywords to be skipped the process that add reviewers if pull requests include it +# A list of keywords to be skipped the process that add reviewers if pull requests include it skipKeywords: - wip diff --git a/.github/workflows/auto_close_prs.yml b/.github/workflows/auto_close_prs.yml index 4266f5e711..a18e0ea135 100644 --- a/.github/workflows/auto_close_prs.yml +++ b/.github/workflows/auto_close_prs.yml @@ -2,7 +2,7 @@ name: Auto Close Unsigned PRs on: schedule: - - cron: '0 0 * * *' # Run daily at midnight UTC + - cron: "0 0 * * *" # Run daily at midnight UTC jobs: close-unsigned-prs: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9e5d8acc0..5416bffed1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] env: NODE_ENV: test @@ -25,39 +25,39 @@ jobs: node-version: [20.x, 22.x] steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'yarn' - - - name: Install dependencies - run: yarn install --frozen-lockfile + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: "yarn" + + - name: Install dependencies + run: yarn install --frozen-lockfile lint: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 22.x - cache: 'yarn' - - run: yarn install --frozen-lockfile - - run: yarn lint + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22.x + cache: "yarn" + - run: yarn install --frozen-lockfile + - run: yarn lint types: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 22.x - cache: 'yarn' - - run: yarn install --frozen-lockfile - - run: yarn tsc + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22.x + cache: "yarn" + - run: yarn install --frozen-lockfile + - run: yarn tsc changes: runs-on: ubuntu-latest @@ -89,13 +89,13 @@ jobs: matrix: test-group: [app, shared] steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 22.x - cache: 'yarn' - - run: yarn install --frozen-lockfile - - run: yarn test:${{ matrix.test-group }} + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22.x + cache: "yarn" + - run: yarn install --frozen-lockfile + - run: yarn test:${{ matrix.test-group }} test-server: needs: [build, changes] @@ -115,7 +115,7 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 - + redis: image: redis:5.0 ports: @@ -129,37 +129,37 @@ jobs: strategy: matrix: shard: [1, 2, 3] - + steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 22.x - cache: 'yarn' - - run: yarn install --frozen-lockfile - - run: yarn sequelize db:migrate - - name: Run server tests - run: | - TESTFILES=$(find . -name "*.test.ts" -path "*/server/*" | sort | split -n -d -l $(($(find . -name "*.test.ts" -path "*/server/*" | wc -l)/${{ matrix.shard }})) - | sed -n "${{ matrix.shard }}p") - yarn test --maxWorkers=2 $TESTFILES + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22.x + cache: "yarn" + - run: yarn install --frozen-lockfile + - run: yarn sequelize db:migrate + - name: Run server tests + run: | + TESTFILES=$(find . -name "*.test.ts" -path "*/server/*" | sort | split -n -d -l $(($(find . -name "*.test.ts" -path "*/server/*" | wc -l)/${{ matrix.shard }})) - | sed -n "${{ matrix.shard }}p") + yarn test --maxWorkers=2 $TESTFILES bundle-size: needs: [build, types, changes] if: ${{ needs.changes.outputs.app == 'true' && github.repository == 'outline/outline' }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 22.x - cache: 'yarn' - - run: yarn install --frozen-lockfile - - name: Set environment to production - run: echo "NODE_ENV=production" >> $GITHUB_ENV - - run: yarn vite:build - - name: Send bundle stats to RelativeCI - uses: relative-ci/agent-action@v2 - with: - key: ${{ secrets.RELATIVE_CI_KEY }} - token: ${{ secrets.GITHUB_TOKEN }} - webpackStatsFile: ./build/app/webpack-stats.json + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22.x + cache: "yarn" + - run: yarn install --frozen-lockfile + - name: Set environment to production + run: echo "NODE_ENV=production" >> $GITHUB_ENV + - run: yarn vite:build + - name: Send bundle stats to RelativeCI + uses: relative-ci/agent-action@v2 + with: + key: ${{ secrets.RELATIVE_CI_KEY }} + token: ${{ secrets.GITHUB_TOKEN }} + webpackStatsFile: ./build/app/webpack-stats.json diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7ae11976fb..aa268494dc 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,12 +13,12 @@ name: "CodeQL" on: push: - branches: [ main ] + branches: [main] pull_request: # The branches below must be a subset of the branches above - branches: [ main ] + branches: [main] schedule: - - cron: '28 15 * * 2' + - cron: "28 15 * * 2" jobs: analyze: @@ -32,39 +32,39 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'javascript' ] + language: ["javascript"] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Learn more about CodeQL language support at https://git.io/codeql-language-support steps: - - name: Checkout repository - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v2 - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language - #- run: | - # make bootstrap - # make release + #- run: | + # make bootstrap + # make release - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 478a0aaaf9..58cab62a16 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -209,4 +209,4 @@ jobs: - name: Inspect image run: | - docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} \ No newline at end of file + docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b4f59218ee..449aa9e909 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,7 +2,7 @@ name: Lint on: pull_request: - branches: [ main ] + branches: [main] jobs: run-linters: @@ -20,11 +20,11 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 20.x - cache: 'yarn' + cache: "yarn" - run: yarn install --frozen-lockfile - run: yarn lint --fix - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v5 with: - commit_message: 'Applied automatic fixes' + commit_message: "Applied automatic fixes" diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..b02580b96e --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "printWidth": 80, + "trailingComma": "es5" +} diff --git a/__mocks__/fileMock.js b/__mocks__/fileMock.js index 08d725cd4e..9cf3c27e74 100644 --- a/__mocks__/fileMock.js +++ b/__mocks__/fileMock.js @@ -1 +1 @@ -export default ''; +export default ""; diff --git a/__mocks__/localStorage.js b/__mocks__/localStorage.js index 3d8394b99b..19e47a4d3e 100644 --- a/__mocks__/localStorage.js +++ b/__mocks__/localStorage.js @@ -1,19 +1,19 @@ const storage = {}; export default { - setItem: function(key, value) { - storage[key] = value || ''; + setItem: function (key, value) { + storage[key] = value || ""; }, - getItem: function(key) { + getItem: function (key) { return key in storage ? storage[key] : null; }, - removeItem: function(key) { + removeItem: function (key) { delete storage[key]; }, get length() { return Object.keys(storage).length; }, - key: function(i) { + key: function (i) { var keys = Object.keys(storage); return keys[i] || null; }, diff --git a/app.json b/app.json index 447a183d29..6c7b0b7533 100644 --- a/app.json +++ b/app.json @@ -3,13 +3,7 @@ "description": "Open source wiki and knowledge base for growing teams", "website": "https://www.getoutline.com/", "repository": "https://github.com/outline/outline", - "keywords": [ - "wiki", - "team", - "node", - "markdown", - "slack" - ], + "keywords": ["wiki", "team", "node", "markdown", "slack"], "success_url": "/", "formation": { "web": { @@ -222,4 +216,4 @@ "required": false } } -} \ No newline at end of file +} diff --git a/app/models/Collection.test.ts b/app/models/Collection.test.ts index e93f1f54b8..499023905f 100644 --- a/app/models/Collection.test.ts +++ b/app/models/Collection.test.ts @@ -1,12 +1,12 @@ /* eslint-disable */ import stores from "~/stores"; -describe('Collection model', () => { - test('should initialize with data', () => { +describe("Collection model", () => { + test("should initialize with data", () => { const collection = stores.collections.add({ id: "123", - name: 'Engineering' + name: "Engineering", }); - expect(collection.name).toBe('Engineering'); + expect(collection.name).toBe("Engineering"); }); -}); \ No newline at end of file +}); diff --git a/app/utils/__mocks__/ApiClient.ts b/app/utils/__mocks__/ApiClient.ts index 2b999661c7..cc8ac96e0c 100644 --- a/app/utils/__mocks__/ApiClient.ts +++ b/app/utils/__mocks__/ApiClient.ts @@ -1,11 +1,13 @@ /* eslint-disable */ -export const client = { - post: jest.fn(() => Promise.resolve({ - data: { - user: {}, - team: {}, - groups: [], - groupUsers: [], - } - })) +export const client = { + post: jest.fn(() => + Promise.resolve({ + data: { + user: {}, + team: {}, + groups: [], + groupUsers: [], + }, + }) + ), }; diff --git a/crowdin.yml b/crowdin.yml index 6dd8611671..01b2941e01 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,5 +1,5 @@ -commit_message: 'fix: New %language% translations from Crowdin [ci skip]' -append_commit_message: +commit_message: "fix: New %language% translations from Crowdin [ci skip]" +append_commit_message: files: - source: /shared/i18n/locales/en_US/translation.json translation: /shared/i18n/locales/%locale_with_underscore%/translation.json diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md index 3caf91a7df..67dcad92ac 100644 --- a/docs/CODE_OF_CONDUCT.md +++ b/docs/CODE_OF_CONDUCT.md @@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo Examples of behavior that contributes to creating a positive environment include: -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities diff --git a/docs/SERVICES.md b/docs/SERVICES.md index 72e4986e0f..7cb2d83f79 100644 --- a/docs/SERVICES.md +++ b/docs/SERVICES.md @@ -32,14 +32,14 @@ At least one worker process is required to process the [queues](../server/queues ## Collaboration -The collaboration server coordinates all realtime editing and updating of documents, +The collaboration server coordinates all realtime editing and updating of documents, it can be ran on the same box as the web server or separately. ```bash yarn start --services=collaboration ``` -If the collaboration service is hosted on a separate domain then the `COLLABORATION_URL` -env must be set to the publicly accessible URL. For example, if the app is hosted at +If the collaboration service is hosted on a separate domain then the `COLLABORATION_URL` +env must be set to the publicly accessible URL. For example, if the app is hosted at `https://docs.example.com` you may use something like: `COLLABORATION_URL=wss://docs-collaboration.example.com`. diff --git a/docs/TRANSLATION.md b/docs/TRANSLATION.md index b69b10160f..e4662c2baf 100644 --- a/docs/TRANSLATION.md +++ b/docs/TRANSLATION.md @@ -1,6 +1,6 @@ # Translation -Outline is localized through community contributions. The text in Outline's user interface is in American English by default, we're very thankful for all help that the community provides bringing the app to different languages. +Outline is localized through community contributions. The text in Outline's user interface is in American English by default, we're very thankful for all help that the community provides bringing the app to different languages. ## Externalizing strings @@ -17,7 +17,7 @@ To manage the translation process we use [CrowdIn](https://translate.getoutline. You'll need to create a free account to use CrowdIn. Once you have joined, you can provide translations by following these steps: 1. Select the language for which you want to contribute (or vote for) a translation (below the language you can see the progress of the translation) - +  2. Please choose the translation.json file from your desired language @@ -31,4 +31,4 @@ If you are interested in becoming a proof reader, please contact one of the proj ## Release -Updated translations are automatically PR'd against the codebase by a bot and will be merged regularly so that new translations appear in the next release of Outline. \ No newline at end of file +Updated translations are automatically PR'd against the codebase by a bot and will be merged regularly so that new translations appear in the next release of Outline. diff --git a/lint-staged.config.mjs b/lint-staged.config.mjs index bb4aa2e3da..55083a17bb 100644 --- a/lint-staged.config.mjs +++ b/lint-staged.config.mjs @@ -1,7 +1,8 @@ export default { - // Efficiently run prettier and translation updates on changes to JS and + // Run prettier first for formatting, then eslint for linting, and translation updates on changes to JS and // TypeScript files "**/*.[tj]s?(x)": [ + (f) => `prettier --write ${f.join(" ")}`, (f) => (f.length > 20 ? `yarn lint --fix` : `eslint ${f.join(" ")} --fix`), () => `yarn build:i18n`, () => "git add shared/i18n/locales/en_US/translation.json", diff --git a/package.json b/package.json index c83ac946d5..153d103f6f 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,8 @@ "dev:watch": "NODE_ENV=development yarn concurrently -n backend,frontend \"yarn dev:backend\" \"yarn vite:dev\"", "lint": "eslint app server shared plugins", "lint:changed": "git diff --name-only --diff-filter=ACMRTUXB | grep -E '\\.(js|jsx|ts|tsx)$' | xargs -r yarn eslint --fix", + "format": "prettier --write .", + "format:check": "prettier --check .", "prepare": "husky install", "postinstall": "yarn patch-package", "install-local-ssl": "node ./server/scripts/install-local-ssl.js", @@ -356,7 +358,6 @@ "eslint-plugin-jsx-a11y": "^6.10.2", "eslint-plugin-lodash": "^7.4.0", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^5.5.1", "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-hooks": "^4.6.2", "husky": "^8.0.3", diff --git a/plugins/discord/plugin.json b/plugins/discord/plugin.json index e075c6227a..24eb977fc2 100644 --- a/plugins/discord/plugin.json +++ b/plugins/discord/plugin.json @@ -1,6 +1,6 @@ { - "id": "discord", - "name": "Discord", - "priority": 10, - "description": "Adds a Discord authentication provider." -} \ No newline at end of file + "id": "discord", + "name": "Discord", + "priority": 10, + "description": "Adds a Discord authentication provider." +} diff --git a/plugins/notion/plugin.json b/plugins/notion/plugin.json index 28d08b51d1..a969306813 100644 --- a/plugins/notion/plugin.json +++ b/plugins/notion/plugin.json @@ -2,4 +2,4 @@ "id": "notion", "name": "Notion", "description": "Adds a Notion integration for importing data." -} \ No newline at end of file +} diff --git a/plugins/umami/plugin.json b/plugins/umami/plugin.json index 49618d1eb0..498d4146be 100644 --- a/plugins/umami/plugin.json +++ b/plugins/umami/plugin.json @@ -3,8 +3,5 @@ "name": "Umami", "priority": 50, "description": "Adds support for reporting analytics to a Umami server.", - "deployments": [ - "community", - "enterprise" - ] -} \ No newline at end of file + "deployments": ["community", "enterprise"] +} diff --git a/server/migrations/20171225143838-set-admins.js b/server/migrations/20171225143838-set-admins.js index f95b207609..33e9783b77 100644 --- a/server/migrations/20171225143838-set-admins.js +++ b/server/migrations/20171225143838-set-admins.js @@ -1,8 +1,7 @@ module.exports = { up: async (queryInterface, Sequelize) => { - const [teams, metaData] = await queryInterface.sequelize.query( - `SELECT * FROM teams` - ); + const [teams, metaData] = + await queryInterface.sequelize.query(`SELECT * FROM teams`); const teamIds = teams.map((team) => team.id); await Promise.all( diff --git a/server/migrations/20211218185045-remove-unused-indexes.js b/server/migrations/20211218185045-remove-unused-indexes.js index 3fee04dbf9..dacc7d1641 100644 --- a/server/migrations/20211218185045-remove-unused-indexes.js +++ b/server/migrations/20211218185045-remove-unused-indexes.js @@ -2,12 +2,15 @@ module.exports = { up: async (queryInterface, Sequelize) => { - await queryInterface.removeIndex("documents", "documents_id_atlas_id_deleted_at"); + await queryInterface.removeIndex( + "documents", + "documents_id_atlas_id_deleted_at" + ); await queryInterface.removeIndex("apiKeys", "api_keys_secret_deleted_at"); await queryInterface.removeIndex("groups", "groups_deleted_at"); }, down: async (queryInterface, Sequelize) => { // noop - } -}; \ No newline at end of file + }, +}; diff --git a/server/migrations/20211221031430-create-pins.js b/server/migrations/20211221031430-create-pins.js index 3547f350ce..fab6064646 100644 --- a/server/migrations/20211221031430-create-pins.js +++ b/server/migrations/20211221031430-create-pins.js @@ -57,10 +57,13 @@ module.exports = { await queryInterface.addIndex("pins", ["collectionId"]); const createdAt = new Date(); - const [documents] = await queryInterface.sequelize.query(`SELECT "id","collectionId","teamId","pinnedById" FROM documents WHERE "pinnedById" IS NOT NULL`); + const [documents] = await queryInterface.sequelize.query( + `SELECT "id","collectionId","teamId","pinnedById" FROM documents WHERE "pinnedById" IS NOT NULL` + ); for (const document of documents) { - await queryInterface.sequelize.query(` + await queryInterface.sequelize.query( + ` INSERT INTO pins ( "id", "documentId", @@ -79,17 +82,19 @@ module.exports = { :createdAt, :updatedAt ) - `, { - replacements: { - id: v4(), - documentId: document.id, - collectionId: document.collectionId, - teamId: document.teamId, - createdById: document.pinnedById, - updatedAt: createdAt, - createdAt, - }, - }); + `, + { + replacements: { + id: v4(), + documentId: document.id, + collectionId: document.collectionId, + teamId: document.teamId, + createdById: document.pinnedById, + updatedAt: createdAt, + createdAt, + }, + } + ); } }, down: async (queryInterface, Sequelize) => { diff --git a/server/migrations/20220127000000-index-fixes.js b/server/migrations/20220127000000-index-fixes.js index 27c6638a11..5e9aadf371 100644 --- a/server/migrations/20220127000000-index-fixes.js +++ b/server/migrations/20220127000000-index-fixes.js @@ -26,16 +26,28 @@ module.exports = { // 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_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"); + 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( + "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"); diff --git a/server/migrations/20220129092607-add-defaultCollectionId.js b/server/migrations/20220129092607-add-defaultCollectionId.js index 331e791796..70e481bbfe 100644 --- a/server/migrations/20220129092607-add-defaultCollectionId.js +++ b/server/migrations/20220129092607-add-defaultCollectionId.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { @@ -11,5 +11,5 @@ module.exports = { down: async (queryInterface, Sequelize) => { await queryInterface.removeColumn("teams", "defaultCollectionId"); - } + }, }; diff --git a/server/migrations/20220305195830-create-comments.js b/server/migrations/20220305195830-create-comments.js index 2cac5d06d2..00e9249cff 100644 --- a/server/migrations/20220305195830-create-comments.js +++ b/server/migrations/20220305195830-create-comments.js @@ -6,58 +6,58 @@ module.exports = { id: { type: Sequelize.UUID, allowNull: false, - primaryKey: true + primaryKey: true, }, data: { type: Sequelize.JSONB, - allowNull: false + allowNull: false, }, documentId: { type: Sequelize.UUID, allowNull: false, onDelete: "cascade", references: { - model: "documents" - } + model: "documents", + }, }, parentCommentId: { type: Sequelize.UUID, allowNull: true, onDelete: "cascade", references: { - model: "comments" - } + model: "comments", + }, }, createdById: { type: Sequelize.UUID, allowNull: false, references: { - model: "users" - } + model: "users", + }, }, resolvedAt: { type: Sequelize.DATE, - allowNull: true + allowNull: true, }, resolvedById: { type: Sequelize.UUID, allowNull: true, references: { - model: "users" - } + model: "users", + }, }, createdAt: { type: Sequelize.DATE, - allowNull: false + allowNull: false, }, updatedAt: { type: Sequelize.DATE, - allowNull: false + allowNull: false, }, deletedAt: { type: Sequelize.DATE, - allowNull: true - } + allowNull: true, + }, }); await queryInterface.addIndex("comments", ["documentId"]); @@ -66,5 +66,5 @@ module.exports = { down: async (queryInterface, Sequelize) => { queryInterface.dropTable("comments"); - } -}; \ No newline at end of file + }, +}; diff --git a/server/migrations/20220311020825-views-indexes.js b/server/migrations/20220311020825-views-indexes.js index 74331a1b5f..ba6972364a 100644 --- a/server/migrations/20220311020825-views-indexes.js +++ b/server/migrations/20220311020825-views-indexes.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { @@ -16,6 +16,9 @@ module.exports = { down: async (queryInterface, Sequelize) => { await queryInterface.removeIndex("views", "views_updated_at"); await queryInterface.removeIndex("views", "views_user_id"); - await queryInterface.removeIndex("collection_users", "collection_users_user_id"); - } + await queryInterface.removeIndex( + "collection_users", + "collection_users_user_id" + ); + }, }; diff --git a/server/migrations/20220319022812-events-indexes.js b/server/migrations/20220319022812-events-indexes.js index 5c39dfdd60..9093ef40b5 100644 --- a/server/migrations/20220319022812-events-indexes.js +++ b/server/migrations/20220319022812-events-indexes.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { @@ -9,5 +9,5 @@ module.exports = { down: async (queryInterface, Sequelize) => { await queryInterface.removeIndex("events", "events_created_at"); - } + }, }; diff --git a/server/migrations/20220319060408-collection-create-permission.js b/server/migrations/20220319060408-collection-create-permission.js index 797e477c11..5aa5bf6465 100644 --- a/server/migrations/20220319060408-collection-create-permission.js +++ b/server/migrations/20220319060408-collection-create-permission.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { @@ -11,5 +11,5 @@ module.exports = { down: async (queryInterface, Sequelize) => { await queryInterface.removeColumn("teams", "memberCollectionCreate"); - } + }, }; diff --git a/server/migrations/20220328215615-add-shareId-to-search-queries.js b/server/migrations/20220328215615-add-shareId-to-search-queries.js index 9e55adc510..54b10a88f4 100644 --- a/server/migrations/20220328215615-add-shareId-to-search-queries.js +++ b/server/migrations/20220328215615-add-shareId-to-search-queries.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { @@ -8,7 +8,7 @@ module.exports = { allowNull: true, references: { model: "shares", - key: "id" + key: "id", }, }); }, diff --git a/server/migrations/20220402032204-starred-collections.js b/server/migrations/20220402032204-starred-collections.js index 451e5fa773..86aee02521 100644 --- a/server/migrations/20220402032204-starred-collections.js +++ b/server/migrations/20220402032204-starred-collections.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { @@ -23,7 +23,7 @@ module.exports = { }); await queryInterface.changeColumn("stars", "documentId", { type: Sequelize.UUID, - allowNull: true + allowNull: true, }); await queryInterface.changeColumn("stars", "documentId", { type: Sequelize.UUID, @@ -46,9 +46,9 @@ module.exports = { await queryInterface.removeColumn("stars", "collectionId"); await queryInterface.changeColumn("stars", "documentId", { type: Sequelize.UUID, - allowNull: false + allowNull: false, }); - await queryInterface.removeConstraint("stars", "stars_documentId_fkey") - await queryInterface.removeConstraint("stars", "stars_userId_fkey") - } + await queryInterface.removeConstraint("stars", "stars_documentId_fkey"); + await queryInterface.removeConstraint("stars", "stars_userId_fkey"); + }, }; diff --git a/server/migrations/20220409222213-user-flags.js b/server/migrations/20220409222213-user-flags.js index 3d31e13ab9..7d8253fe5a 100644 --- a/server/migrations/20220409222213-user-flags.js +++ b/server/migrations/20220409222213-user-flags.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { @@ -10,5 +10,5 @@ module.exports = { down: async (queryInterface) => { return queryInterface.removeColumn("users", "flags"); - } + }, }; diff --git a/server/migrations/20220409225935-user-invited-by.js b/server/migrations/20220409225935-user-invited-by.js index 54806dd6a3..4f63e29efd 100644 --- a/server/migrations/20220409225935-user-invited-by.js +++ b/server/migrations/20220409225935-user-invited-by.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { @@ -13,5 +13,5 @@ module.exports = { down: async (queryInterface) => { return queryInterface.removeColumn("users", "invitedById"); - } + }, }; diff --git a/server/migrations/20220413213537-add-inviteRequired-to-teams.js b/server/migrations/20220413213537-add-inviteRequired-to-teams.js index 5d20ac3ba9..560af4b06b 100644 --- a/server/migrations/20220413213537-add-inviteRequired-to-teams.js +++ b/server/migrations/20220413213537-add-inviteRequired-to-teams.js @@ -1,11 +1,11 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { await queryInterface.addColumn("teams", "inviteRequired", { type: Sequelize.BOOLEAN, defaultValue: false, - allowNull: false + allowNull: false, }); }, down: async (queryInterface) => { diff --git a/server/migrations/20220419052832-create-team-domains.js b/server/migrations/20220419052832-create-team-domains.js index 3944de7392..5702f3ae1c 100644 --- a/server/migrations/20220419052832-create-team-domains.js +++ b/server/migrations/20220419052832-create-team-domains.js @@ -5,65 +5,80 @@ const { v4 } = require("uuid"); module.exports = { up: async (queryInterface, Sequelize) => { await queryInterface.sequelize.transaction(async (transaction) => { - await queryInterface.createTable("team_domains", { - id: { - type: Sequelize.UUID, - allowNull: false, - primaryKey: true, - }, - teamId: { - type: Sequelize.UUID, - allowNull: false, - onDelete: "cascade", - references: { - model: "teams", + await queryInterface.createTable( + "team_domains", + { + id: { + type: Sequelize.UUID, + allowNull: false, + primaryKey: true, + }, + teamId: { + type: Sequelize.UUID, + allowNull: false, + onDelete: "cascade", + references: { + model: "teams", + }, + }, + createdById: { + type: Sequelize.UUID, + allowNull: false, + references: { + model: "users", + }, + }, + name: { + type: Sequelize.STRING, + allowNull: false, + }, + createdAt: { + type: Sequelize.DATE, + allowNull: false, + }, + updatedAt: { + type: Sequelize.DATE, + allowNull: false, }, }, - createdById: { - type: Sequelize.UUID, - allowNull: false, - references: { - model: "users", - }, - }, - name: { - type: Sequelize.STRING, - allowNull: false, - }, - createdAt: { - type: Sequelize.DATE, - allowNull: false, - }, - updatedAt: { - type: Sequelize.DATE, - allowNull: false, - }, - }, { - transaction - }); + { + transaction, + } + ); await queryInterface.addIndex("team_domains", ["teamId", "name"], { transaction, unique: true, }); - const currentAllowedDomainsEnv = process.env.ALLOWED_DOMAINS || process.env.GOOGLE_ALLOWED_DOMAINS; - const currentAllowedDomains = currentAllowedDomainsEnv ? currentAllowedDomainsEnv.split(",") : []; + const currentAllowedDomainsEnv = + process.env.ALLOWED_DOMAINS || process.env.GOOGLE_ALLOWED_DOMAINS; + const currentAllowedDomains = currentAllowedDomainsEnv + ? currentAllowedDomainsEnv.split(",") + : []; if (currentAllowedDomains.length > 0) { - const [adminUserIDs] = await queryInterface.sequelize.query('select id from users where "isAdmin" = true limit 1', { transaction }) - const adminUserID = adminUserIDs[0]?.id + const [adminUserIDs] = await queryInterface.sequelize.query( + 'select id from users where "isAdmin" = true limit 1', + { transaction } + ); + const adminUserID = adminUserIDs[0]?.id; if (adminUserID) { - const [teams] = await queryInterface.sequelize.query('select id from teams', { transaction }) + const [teams] = await queryInterface.sequelize.query( + "select id from teams", + { transaction } + ); const now = new Date(); for (const team of teams) { for (const domain of currentAllowedDomains) { - await queryInterface.sequelize.query(` + await queryInterface.sequelize.query( + ` INSERT INTO team_domains ("id", "teamId", "createdById", "name", "createdAt", "updatedAt") VALUES (:id, :teamId, :createdById, :name, :createdAt, :updatedAt) - `, { + `, + { replacements: { id: v4(), teamId: team.id, diff --git a/server/migrations/20220421052253-create-file-operation-format.js b/server/migrations/20220421052253-create-file-operation-format.js index 198fdf6378..db1ed37f1b 100644 --- a/server/migrations/20220421052253-create-file-operation-format.js +++ b/server/migrations/20220421052253-create-file-operation-format.js @@ -1,11 +1,11 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { await queryInterface.addColumn("file_operations", "format", { type: Sequelize.STRING, defaultValue: "outline-markdown", - allowNull: false + allowNull: false, }); }, down: async (queryInterface) => { diff --git a/server/migrations/20220430043135-collection-sort-backfill.js b/server/migrations/20220430043135-collection-sort-backfill.js index 8b18a8fc39..b3bd4127b4 100644 --- a/server/migrations/20220430043135-collection-sort-backfill.js +++ b/server/migrations/20220430043135-collection-sort-backfill.js @@ -1,23 +1,26 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface) => { let again = 1; - + while (again) { console.log("Backfilling collection sort…"); - const [, metadata] = await queryInterface.sequelize.query(` + const [, metadata] = await queryInterface.sequelize.query( + ` WITH rows AS ( SELECT id FROM collections WHERE "sort" IS NULL ORDER BY id LIMIT 1000 ) UPDATE collections SET "sort" = :sort::jsonb WHERE EXISTS (SELECT * FROM rows WHERE collections.id = rows.id) - `, { - replacements: { - sort: JSON.stringify({ field: "title", direction: "asc" }), + `, + { + replacements: { + sort: JSON.stringify({ field: "title", direction: "asc" }), + }, } - }); + ); again = metadata.rowCount; } @@ -25,5 +28,5 @@ WHERE EXISTS (SELECT * FROM rows WHERE collections.id = rows.id) down: async () => { // cannot be undone - } + }, }; diff --git a/server/migrations/20220525054603-user-authentication-expires-at.js b/server/migrations/20220525054603-user-authentication-expires-at.js index 4fff2516f0..a0060b8d4f 100644 --- a/server/migrations/20220525054603-user-authentication-expires-at.js +++ b/server/migrations/20220525054603-user-authentication-expires-at.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { @@ -6,13 +6,17 @@ module.exports = { await queryInterface.addColumn("user_authentications", "expiresAt", { type: Sequelize.DATE, allowNull: true, - transaction - }); - await queryInterface.addColumn("user_authentications", "lastValidatedAt", { - type: Sequelize.DATE, - allowNull: true, - transaction + transaction, }); + await queryInterface.addColumn( + "user_authentications", + "lastValidatedAt", + { + type: Sequelize.DATE, + allowNull: true, + transaction, + } + ); }); }, down: async (queryInterface) => { @@ -21,12 +25,12 @@ module.exports = { "user_authentications", "lastValidatedAt", { - transaction + transaction, } ); await queryInterface.removeColumn("user_authentications", "expiresAt", { - transaction + transaction, }); }); - }, + }, }; diff --git a/server/migrations/20220702132722-add-webhooks-deleted-at.js b/server/migrations/20220702132722-add-webhooks-deleted-at.js index 13f530e075..473c4a5c86 100644 --- a/server/migrations/20220702132722-add-webhooks-deleted-at.js +++ b/server/migrations/20220702132722-add-webhooks-deleted-at.js @@ -1,10 +1,10 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { await queryInterface.addColumn("webhook_subscriptions", "deletedAt", { type: Sequelize.DATE, - allowNull: true + allowNull: true, }); }, down: async (queryInterface) => { diff --git a/server/migrations/20220720221531-remove-deprecated-columns.js b/server/migrations/20220720221531-remove-deprecated-columns.js index f237d91734..3f7ed233d0 100644 --- a/server/migrations/20220720221531-remove-deprecated-columns.js +++ b/server/migrations/20220720221531-remove-deprecated-columns.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; module.exports = { async up(queryInterface) { @@ -16,7 +16,9 @@ module.exports = { ); if (teams[0].count > 0 && authenticationProviders[0].count === 0) { - throw Error("Refusing to destroy deprecated columns without authentication providers"); + throw Error( + "Refusing to destroy deprecated columns without authentication providers" + ); } } @@ -34,28 +36,28 @@ module.exports = { type: Sequelize.STRING(4096), allowNull: false, defaultValue: "", - transaction + transaction, }); await queryInterface.addColumn("users", "service", { type: Sequelize.STRING, allowNull: true, - transaction + transaction, }); await queryInterface.addColumn("users", "serviceId", { type: Sequelize.STRING, allowNull: true, - transaction + transaction, }); await queryInterface.addColumn("teams", "slackId", { type: Sequelize.STRING, allowNull: true, - transaction + transaction, }); await queryInterface.addColumn("teams", "googleId", { type: Sequelize.STRING, allowNull: true, - transaction + transaction, }); }); - } + }, }; diff --git a/server/migrations/20220722184916-remove-event-updatedat.js b/server/migrations/20220722184916-remove-event-updatedat.js index 84e9fe0104..9744da01c3 100644 --- a/server/migrations/20220722184916-remove-event-updatedat.js +++ b/server/migrations/20220722184916-remove-event-updatedat.js @@ -1,14 +1,14 @@ -'use strict'; +"use strict"; module.exports = { - async up (queryInterface, Sequelize) { + async up(queryInterface, Sequelize) { await queryInterface.removeColumn("events", "updatedAt"); }, - async down (queryInterface, Sequelize) { + async down(queryInterface, Sequelize) { await queryInterface.addColumn("events", "updatedAt", { type: Sequelize.DATE, allowNull: false, - defaultValue: Sequelize.fn('NOW'), + defaultValue: Sequelize.fn("NOW"), }); - } + }, }; diff --git a/server/migrations/20220810185000-scope-provider-id-uniqueness-to-team.js b/server/migrations/20220810185000-scope-provider-id-uniqueness-to-team.js index bdb794a9cf..ece722085d 100644 --- a/server/migrations/20220810185000-scope-provider-id-uniqueness-to-team.js +++ b/server/migrations/20220810185000-scope-provider-id-uniqueness-to-team.js @@ -1,21 +1,27 @@ -'use strict'; +"use strict"; module.exports = { - async up (queryInterface, Sequelize) { - await queryInterface.removeConstraint("authentication_providers", "authentication_providers_providerId_key"); + async up(queryInterface, Sequelize) { + await queryInterface.removeConstraint( + "authentication_providers", + "authentication_providers_providerId_key" + ); await queryInterface.addConstraint("authentication_providers", { - type: 'unique', + type: "unique", fields: ["providerId", "teamId"], - name: "authentication_providers_providerId_teamId_uk" + name: "authentication_providers_providerId_teamId_uk", }); }, - async down (queryInterface, Sequelize) { - await queryInterface.removeConstraint("authentication_providers", "authentication_providers_providerId_teamId_uk"); + async down(queryInterface, Sequelize) { + await queryInterface.removeConstraint( + "authentication_providers", + "authentication_providers_providerId_teamId_uk" + ); await queryInterface.addConstraint("authentication_providers", { - type: 'unique', + type: "unique", fields: ["providerId"], - name: "authentication_providers_providerId_key" + name: "authentication_providers_providerId_key", }); - } + }, }; diff --git a/server/migrations/20220812115059-scope-user-auth-provider-id-uniqueness-to-user.js b/server/migrations/20220812115059-scope-user-auth-provider-id-uniqueness-to-user.js index 4fa5fa0edb..13d22b0c45 100644 --- a/server/migrations/20220812115059-scope-user-auth-provider-id-uniqueness-to-user.js +++ b/server/migrations/20220812115059-scope-user-auth-provider-id-uniqueness-to-user.js @@ -1,21 +1,27 @@ -'use strict'; +"use strict"; module.exports = { - async up (queryInterface, Sequelize) { - await queryInterface.removeConstraint("user_authentications", "user_authentications_providerId_key"); + async up(queryInterface, Sequelize) { + await queryInterface.removeConstraint( + "user_authentications", + "user_authentications_providerId_key" + ); await queryInterface.addConstraint("user_authentications", { - type: 'unique', + type: "unique", fields: ["providerId", "userId"], - name: "user_authentications_providerId_userId_uk" + name: "user_authentications_providerId_userId_uk", }); }, - async down (queryInterface, Sequelize) { - await queryInterface.removeConstraint("user_authentications", "user_authentications_providerId_userId_uk"); + async down(queryInterface, Sequelize) { + await queryInterface.removeConstraint( + "user_authentications", + "user_authentications_providerId_userId_uk" + ); await queryInterface.addConstraint("user_authentications", { - type: 'unique', + type: "unique", fields: ["providerId"], - name: "user_authentications_providerId_key" + name: "user_authentications_providerId_key", }); - } + }, }; diff --git a/server/migrations/20220816175234-user-email-index.js b/server/migrations/20220816175234-user-email-index.js index 9e97b2b02c..31e3fa70e5 100644 --- a/server/migrations/20220816175234-user-email-index.js +++ b/server/migrations/20220816175234-user-email-index.js @@ -1,11 +1,11 @@ -'use strict'; +"use strict"; module.exports = { - async up (queryInterface) { + async up(queryInterface) { await queryInterface.addIndex("users", ["email"]); }, - async down (queryInterface) { + async down(queryInterface) { await queryInterface.removeIndex("users", ["email"]); - } + }, }; diff --git a/server/migrations/20220830215146-add-shares-views.js b/server/migrations/20220830215146-add-shares-views.js index 4d537a7bb9..402ac7ad1a 100644 --- a/server/migrations/20220830215146-add-shares-views.js +++ b/server/migrations/20220830215146-add-shares-views.js @@ -1,10 +1,10 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { await queryInterface.addColumn("shares", "views", { type: Sequelize.INTEGER, - defaultValue: 0 + defaultValue: 0, }); }, down: async (queryInterface) => { diff --git a/server/migrations/20220907132304-user-preferences.js b/server/migrations/20220907132304-user-preferences.js index 5fad095fea..60e12089d7 100644 --- a/server/migrations/20220907132304-user-preferences.js +++ b/server/migrations/20220907132304-user-preferences.js @@ -1,14 +1,14 @@ -'use strict'; +"use strict"; module.exports = { - async up (queryInterface, Sequelize) { + async up(queryInterface, Sequelize) { return queryInterface.addColumn("users", "preferences", { type: Sequelize.JSONB, allowNull: true, }); }, - async down (queryInterface, Sequelize) { + async down(queryInterface, Sequelize) { return queryInterface.removeColumn("users", "preferences"); - } + }, }; diff --git a/server/migrations/20220909203454-fix-notification-constraints.js b/server/migrations/20220909203454-fix-notification-constraints.js index b7d153d1da..837bfbe667 100644 --- a/server/migrations/20220909203454-fix-notification-constraints.js +++ b/server/migrations/20220909203454-fix-notification-constraints.js @@ -1,12 +1,28 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { await queryInterface.sequelize.transaction(async (transaction) => { - await queryInterface.removeConstraint("notifications", "notifications_userId_fkey", { transaction }) - await queryInterface.removeConstraint("notifications", "notifications_actorId_fkey", { transaction }) - await queryInterface.removeConstraint("notifications", "notifications_teamId_fkey", { transaction }) - await queryInterface.removeConstraint("notifications", "notifications_documentId_fkey", { transaction }) + await queryInterface.removeConstraint( + "notifications", + "notifications_userId_fkey", + { transaction } + ); + await queryInterface.removeConstraint( + "notifications", + "notifications_actorId_fkey", + { transaction } + ); + await queryInterface.removeConstraint( + "notifications", + "notifications_teamId_fkey", + { transaction } + ); + await queryInterface.removeConstraint( + "notifications", + "notifications_documentId_fkey", + { transaction } + ); }); await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.changeColumn("notifications", "userId", { @@ -49,10 +65,26 @@ module.exports = { down: async (queryInterface, Sequelize) => { await queryInterface.sequelize.transaction(async (transaction) => { - await queryInterface.removeConstraint("notifications", "notifications_userId_fkey", { transaction }) - await queryInterface.removeConstraint("notifications", "notifications_actorId_fkey", { transaction }) - await queryInterface.removeConstraint("notifications", "notifications_teamId_fkey", { transaction }) - await queryInterface.removeConstraint("notifications", "notifications_documentId_fkey", { transaction }) + await queryInterface.removeConstraint( + "notifications", + "notifications_userId_fkey", + { transaction } + ); + await queryInterface.removeConstraint( + "notifications", + "notifications_actorId_fkey", + { transaction } + ); + await queryInterface.removeConstraint( + "notifications", + "notifications_teamId_fkey", + { transaction } + ); + await queryInterface.removeConstraint( + "notifications", + "notifications_documentId_fkey", + { transaction } + ); }); await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.changeColumn("notifications", "userId", { @@ -87,5 +119,5 @@ module.exports = { transaction, }); }); - } + }, }; diff --git a/server/migrations/20220922073737-webhook-signing-secret.js b/server/migrations/20220922073737-webhook-signing-secret.js index 48c54617c6..66b4c5d2f4 100644 --- a/server/migrations/20220922073737-webhook-signing-secret.js +++ b/server/migrations/20220922073737-webhook-signing-secret.js @@ -1,14 +1,14 @@ "use strict"; module.exports = { - async up (queryInterface, Sequelize) { + async up(queryInterface, Sequelize) { return queryInterface.addColumn("webhook_subscriptions", "secret", { type: Sequelize.BLOB, allowNull: true, }); }, - async down (queryInterface, Sequelize) { + async down(queryInterface, Sequelize) { return queryInterface.removeColumn("webhook_subscriptions", "secret"); - } + }, }; diff --git a/server/migrations/20220928030442-fix-avatar-urls.js b/server/migrations/20220928030442-fix-avatar-urls.js index e2790898e7..3d07fcd954 100644 --- a/server/migrations/20220928030442-fix-avatar-urls.js +++ b/server/migrations/20220928030442-fix-avatar-urls.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { @@ -29,5 +29,5 @@ module.exports = { transaction, }); }); - } + }, }; diff --git a/server/migrations/20221111171828-fix-user-constraints.js b/server/migrations/20221111171828-fix-user-constraints.js index 8e5ca0b4db..1a84db522d 100644 --- a/server/migrations/20221111171828-fix-user-constraints.js +++ b/server/migrations/20221111171828-fix-user-constraints.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { @@ -15,5 +15,5 @@ module.exports = { await queryInterface.changeColumn("users", "teamId", { type: Sequelize.UUID, }); - } + }, }; diff --git a/server/migrations/20221112152649-import-document-relationship.js b/server/migrations/20221112152649-import-document-relationship.js index fffde76215..9e8d142052 100644 --- a/server/migrations/20221112152649-import-document-relationship.js +++ b/server/migrations/20221112152649-import-document-relationship.js @@ -20,29 +20,28 @@ module.exports = { transaction, }); await queryInterface.addIndex("documents", ["importId"], { - transaction + transaction, }); await queryInterface.addIndex("collections", ["importId"], { - transaction + transaction, }); }); - }, async down(queryInterface) { await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.removeIndex("collections", ["importId"], { - transaction + transaction, }); await queryInterface.removeIndex("documents", ["importId"], { - transaction + transaction, }); await queryInterface.removeColumn("collections", "importId", { - transaction + transaction, }); await queryInterface.removeColumn("documents", "importId", { - transaction + transaction, }); }); - } + }, }; diff --git a/server/migrations/20221120151710-attachment-expiry.js b/server/migrations/20221120151710-attachment-expiry.js index 8d25673071..6d9797c359 100644 --- a/server/migrations/20221120151710-attachment-expiry.js +++ b/server/migrations/20221120151710-attachment-expiry.js @@ -9,14 +9,18 @@ module.exports = { transaction, }); await queryInterface.addIndex("attachments", ["expiresAt"], { - transaction + transaction, }); }); }, down: async (queryInterface) => { await queryInterface.sequelize.transaction(async (transaction) => { - await queryInterface.removeColumn("attachments", "expiresAt", { transaction }); - await queryInterface.removeIndex("attachments", ["expiresAt"], { transaction }); + await queryInterface.removeColumn("attachments", "expiresAt", { + transaction, + }); + await queryInterface.removeIndex("attachments", ["expiresAt"], { + transaction, + }); }); }, }; diff --git a/server/migrations/20221206163421-add-share-url-slug.js b/server/migrations/20221206163421-add-share-url-slug.js index ce152dc8f3..08a7ca2369 100644 --- a/server/migrations/20221206163421-add-share-url-slug.js +++ b/server/migrations/20221206163421-add-share-url-slug.js @@ -4,15 +4,11 @@ module.exports = { async up(queryInterface, Sequelize) { try { await queryInterface.sequelize.transaction(async (transaction) => { - await queryInterface.addColumn( - "shares", - "urlId", - { - type: Sequelize.STRING, - allowNull: true, - transaction, - }, - ); + await queryInterface.addColumn("shares", "urlId", { + type: Sequelize.STRING, + allowNull: true, + transaction, + }); await queryInterface.addConstraint("shares", { fields: ["urlId", "teamId"], @@ -20,7 +16,7 @@ module.exports = { transaction, }); }); - } catch(err) { + } catch (err) { throw err; } }, diff --git a/server/migrations/20221218013627-fix-webhook-subscription-constraints.js b/server/migrations/20221218013627-fix-webhook-subscription-constraints.js index 37e232ed21..e69a00f8e9 100644 --- a/server/migrations/20221218013627-fix-webhook-subscription-constraints.js +++ b/server/migrations/20221218013627-fix-webhook-subscription-constraints.js @@ -1,8 +1,11 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { - await queryInterface.removeConstraint("webhook_subscriptions", "webhook_subscriptions_teamId_fkey") + await queryInterface.removeConstraint( + "webhook_subscriptions", + "webhook_subscriptions_teamId_fkey" + ); await queryInterface.changeColumn("webhook_subscriptions", "teamId", { type: Sequelize.UUID, allowNull: false, @@ -14,7 +17,10 @@ module.exports = { }, down: async (queryInterface, Sequelize) => { - await queryInterface.removeConstraint("webhook_subscriptions", "webhook_subscriptions_teamId_fkey") + await queryInterface.removeConstraint( + "webhook_subscriptions", + "webhook_subscriptions_teamId_fkey" + ); await queryInterface.changeColumn("webhook_subscriptions", "teamId", { type: Sequelize.UUID, allowNull: false, @@ -22,5 +28,5 @@ module.exports = { model: "teams", }, }); - } + }, }; diff --git a/server/migrations/20221219013835-fix-integration-constraints.js b/server/migrations/20221219013835-fix-integration-constraints.js index 8a20fddfaa..f090a23fed 100644 --- a/server/migrations/20221219013835-fix-integration-constraints.js +++ b/server/migrations/20221219013835-fix-integration-constraints.js @@ -1,8 +1,11 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { - await queryInterface.removeConstraint("integrations", "integrations_collectionId_fkey") + await queryInterface.removeConstraint( + "integrations", + "integrations_collectionId_fkey" + ); await queryInterface.changeColumn("integrations", "collectionId", { type: Sequelize.UUID, allowNull: true, @@ -11,7 +14,10 @@ module.exports = { model: "collections", }, }); - await queryInterface.removeConstraint("integrations", "integrations_teamId_fkey") + await queryInterface.removeConstraint( + "integrations", + "integrations_teamId_fkey" + ); await queryInterface.changeColumn("integrations", "teamId", { type: Sequelize.UUID, allowNull: false, @@ -23,7 +29,10 @@ module.exports = { }, down: async (queryInterface, Sequelize) => { - await queryInterface.removeConstraint("integrations", "integrations_collectionId_fkey") + await queryInterface.removeConstraint( + "integrations", + "integrations_collectionId_fkey" + ); await queryInterface.changeColumn("integrations", "collectionId", { type: Sequelize.UUID, allowNull: true, @@ -31,7 +40,10 @@ module.exports = { model: "collections", }, }); - await queryInterface.removeConstraint("integrations", "integrations_teamId_fkey") + await queryInterface.removeConstraint( + "integrations", + "integrations_teamId_fkey" + ); await queryInterface.changeColumn("integrations", "teamId", { type: Sequelize.UUID, allowNull: false, @@ -39,5 +51,5 @@ module.exports = { model: "teams", }, }); - } + }, }; diff --git a/server/migrations/20221230234256-add-stars-cascade.js b/server/migrations/20221230234256-add-stars-cascade.js index 78704967a4..1f3fb85c2f 100644 --- a/server/migrations/20221230234256-add-stars-cascade.js +++ b/server/migrations/20221230234256-add-stars-cascade.js @@ -1,8 +1,8 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { - await queryInterface.removeConstraint("stars", "stars_collectionId_fkey") + await queryInterface.removeConstraint("stars", "stars_collectionId_fkey"); await queryInterface.changeColumn("stars", "collectionId", { type: Sequelize.UUID, allowNull: true, @@ -14,7 +14,7 @@ module.exports = { }, down: async (queryInterface, Sequelize) => { - await queryInterface.removeConstraint("stars", "stars_collectionId_fkey") + await queryInterface.removeConstraint("stars", "stars_collectionId_fkey"); await queryInterface.changeColumn("stars", "collectionId", { type: Sequelize.UUID, allowNull: true, @@ -22,5 +22,5 @@ module.exports = { model: "collections", }, }); - } + }, }; diff --git a/server/migrations/20230101144349-integration-indexes.js b/server/migrations/20230101144349-integration-indexes.js index 9ac7c0c58c..54b138727a 100644 --- a/server/migrations/20230101144349-integration-indexes.js +++ b/server/migrations/20230101144349-integration-indexes.js @@ -1,11 +1,19 @@ -'use strict'; +"use strict"; module.exports = { - async up (queryInterface, Sequelize) { - await queryInterface.addIndex("integrations", ["teamId", "type", "service"]); + async up(queryInterface, Sequelize) { + await queryInterface.addIndex("integrations", [ + "teamId", + "type", + "service", + ]); }, - async down (queryInterface, Sequelize) { - await queryInterface.removeIndex("integrations", ["teamId", "type", "service"]); - } + async down(queryInterface, Sequelize) { + await queryInterface.removeIndex("integrations", [ + "teamId", + "type", + "service", + ]); + }, }; diff --git a/server/migrations/20230314013103-move-notification-settings.js b/server/migrations/20230314013103-move-notification-settings.js index 7962a25378..2a32735816 100644 --- a/server/migrations/20230314013103-move-notification-settings.js +++ b/server/migrations/20230314013103-move-notification-settings.js @@ -20,7 +20,7 @@ module.exports = { "SELECT id FROM users", { type: queryInterface.sequelize.QueryTypes.SELECT, - transaction + transaction, } ); @@ -30,12 +30,11 @@ module.exports = { { type: queryInterface.sequelize.QueryTypes.SELECT, replacements: { userId: user.id }, - transaction + transaction, } ); const eventTypes = settings.map((setting) => setting.event); - if (eventTypes.length > 0) { const notificationSettings = {}; @@ -52,7 +51,7 @@ module.exports = { userId: user.id, notificationSettings: JSON.stringify(notificationSettings), }, - transaction + transaction, } ); } @@ -60,7 +59,7 @@ module.exports = { }); }, - async down (queryInterface) { + async down(queryInterface) { return queryInterface.removeColumn("users", "notificationSettings"); - } + }, }; diff --git a/server/migrations/20230403120315-add-comment-to-notifications.js b/server/migrations/20230403120315-add-comment-to-notifications.js index b8845ff6c0..0729854e03 100644 --- a/server/migrations/20230403120315-add-comment-to-notifications.js +++ b/server/migrations/20230403120315-add-comment-to-notifications.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { @@ -31,8 +31,8 @@ module.exports = { }, down: async (queryInterface) => { - await queryInterface.removeColumn("notifications", "collectionId") - await queryInterface.removeColumn("notifications", "revisionId") - await queryInterface.removeColumn("notifications", "commentId") - } + await queryInterface.removeColumn("notifications", "collectionId"); + await queryInterface.removeColumn("notifications", "revisionId"); + await queryInterface.removeColumn("notifications", "commentId"); + }, }; diff --git a/server/migrations/20230429005039-collection-admins.js b/server/migrations/20230429005039-collection-admins.js index 9a5beb3061..c253eca2e0 100644 --- a/server/migrations/20230429005039-collection-admins.js +++ b/server/migrations/20230429005039-collection-admins.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; module.exports = { async up(queryInterface) { @@ -7,7 +7,7 @@ module.exports = { } await queryInterface.sequelize.transaction(async (transaction) => { - // Convert collection members to admins where the user is the only + // Convert collection members to admins where the user is the only // membership in the collection. await queryInterface.sequelize.query( `UPDATE collection_users cu @@ -52,5 +52,5 @@ module.exports = { type: queryInterface.sequelize.QueryTypes.SELECT, } ); - } + }, }; diff --git a/server/migrations/20230430213332-remove-notification-settings.js b/server/migrations/20230430213332-remove-notification-settings.js index a964eb1941..cf70cf844e 100644 --- a/server/migrations/20230430213332-remove-notification-settings.js +++ b/server/migrations/20230430213332-remove-notification-settings.js @@ -1,11 +1,11 @@ -'use strict'; +"use strict"; module.exports = { - async up (queryInterface, Sequelize) { + async up(queryInterface, Sequelize) { await queryInterface.dropTable("notification_settings"); }, - async down (queryInterface, Sequelize) { - throw new Error("Cannot undo this migration.") - } + async down(queryInterface, Sequelize) { + throw new Error("Cannot undo this migration."); + }, }; diff --git a/server/migrations/20230621004649-add-include-attachments-file-operation.js b/server/migrations/20230621004649-add-include-attachments-file-operation.js index 3249c5f0c5..0f7525dbe4 100644 --- a/server/migrations/20230621004649-add-include-attachments-file-operation.js +++ b/server/migrations/20230621004649-add-include-attachments-file-operation.js @@ -1,7 +1,7 @@ -'use strict'; +"use strict"; module.exports = { - async up (queryInterface, Sequelize) { + async up(queryInterface, Sequelize) { await queryInterface.addColumn("file_operations", "includeAttachments", { type: Sequelize.BOOLEAN, allowNull: false, @@ -9,7 +9,7 @@ module.exports = { }); }, - async down (queryInterface, Sequelize) { + async down(queryInterface, Sequelize) { await queryInterface.removeColumn("file_operations", "includeAttachments"); - } + }, }; diff --git a/server/migrations/20230720002422-add-insights-control.js b/server/migrations/20230720002422-add-insights-control.js index a112ba1c78..c3632c6651 100644 --- a/server/migrations/20230720002422-add-insights-control.js +++ b/server/migrations/20230720002422-add-insights-control.js @@ -1,7 +1,7 @@ -'use strict'; +"use strict"; module.exports = { - async up (queryInterface, Sequelize) { + async up(queryInterface, Sequelize) { await queryInterface.addColumn("documents", "insightsEnabled", { type: Sequelize.BOOLEAN, allowNull: false, @@ -9,7 +9,7 @@ module.exports = { }); }, - async down (queryInterface, Sequelize) { + async down(queryInterface, Sequelize) { await queryInterface.removeColumn("documents", "insightsEnabled"); - } + }, }; diff --git a/server/migrations/20230723231806-fix-file-operation-constraints.js b/server/migrations/20230723231806-fix-file-operation-constraints.js index aece89168c..8c54c94334 100644 --- a/server/migrations/20230723231806-fix-file-operation-constraints.js +++ b/server/migrations/20230723231806-fix-file-operation-constraints.js @@ -1,57 +1,93 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { await queryInterface.sequelize.transaction(async (transaction) => { - await queryInterface.removeConstraint("file_operations", "file_operations_collectionId_fkey", { transaction }); - await queryInterface.changeColumn("file_operations", "collectionId", { - type: Sequelize.UUID, - allowNull: true, - onDelete: "cascade", - references: { - model: "collections", + await queryInterface.removeConstraint( + "file_operations", + "file_operations_collectionId_fkey", + { transaction } + ); + await queryInterface.changeColumn( + "file_operations", + "collectionId", + { + type: Sequelize.UUID, + allowNull: true, + onDelete: "cascade", + references: { + model: "collections", + }, }, - }, { - transaction, - }); + { + transaction, + } + ); - await queryInterface.removeConstraint("file_operations", "file_operations_teamId_fkey", { transaction }); - await queryInterface.changeColumn("file_operations", "teamId", { - type: Sequelize.UUID, - allowNull: false, - onDelete: "cascade", - references: { - model: "teams", + await queryInterface.removeConstraint( + "file_operations", + "file_operations_teamId_fkey", + { transaction } + ); + await queryInterface.changeColumn( + "file_operations", + "teamId", + { + type: Sequelize.UUID, + allowNull: false, + onDelete: "cascade", + references: { + model: "teams", + }, }, - }, { - transaction - }); + { + transaction, + } + ); }); }, down: async (queryInterface, Sequelize) => { await queryInterface.sequelize.transaction(async (transaction) => { - await queryInterface.removeConstraint("file_operations", "file_operations_collectionId_fkey", { transaction }); - await queryInterface.changeColumn("file_operations", "collectionId", { - type: Sequelize.UUID, - allowNull: true, - references: { - model: "collections", + await queryInterface.removeConstraint( + "file_operations", + "file_operations_collectionId_fkey", + { transaction } + ); + await queryInterface.changeColumn( + "file_operations", + "collectionId", + { + type: Sequelize.UUID, + allowNull: true, + references: { + model: "collections", + }, }, - }, { - transaction, - }); + { + transaction, + } + ); - await queryInterface.removeConstraint("file_operations", "file_operations_teamId_fkey", { transaction }); - await queryInterface.changeColumn("file_operations", "teamId", { - type: Sequelize.UUID, - allowNull: false, - references: { - model: "teams", + await queryInterface.removeConstraint( + "file_operations", + "file_operations_teamId_fkey", + { transaction } + ); + await queryInterface.changeColumn( + "file_operations", + "teamId", + { + type: Sequelize.UUID, + allowNull: false, + references: { + model: "teams", + }, }, - }, { - transaction, - }); + { + transaction, + } + ); }); - } + }, }; diff --git a/server/migrations/20230815063830-add-emoji-to-revisions.js b/server/migrations/20230815063830-add-emoji-to-revisions.js index 524b85bb29..ff4ca6bebb 100644 --- a/server/migrations/20230815063830-add-emoji-to-revisions.js +++ b/server/migrations/20230815063830-add-emoji-to-revisions.js @@ -1,14 +1,14 @@ -'use strict'; +"use strict"; module.exports = { - async up (queryInterface, Sequelize) { + async up(queryInterface, Sequelize) { await queryInterface.addColumn("revisions", "emoji", { type: Sequelize.STRING, allowNull: true, }); }, - async down (queryInterface) { + async down(queryInterface) { await queryInterface.removeColumn("revisions", "emoji"); - } + }, }; diff --git a/server/migrations/20231001032754-file-operation-paranoid.js b/server/migrations/20231001032754-file-operation-paranoid.js index 9099a3e7a6..f1d30fb848 100644 --- a/server/migrations/20231001032754-file-operation-paranoid.js +++ b/server/migrations/20231001032754-file-operation-paranoid.js @@ -1,14 +1,14 @@ -'use strict'; +"use strict"; module.exports = { - async up (queryInterface, Sequelize) { + async up(queryInterface, Sequelize) { await queryInterface.addColumn("file_operations", "deletedAt", { type: Sequelize.DATE, allowNull: true, }); }, - async down (queryInterface) { + async down(queryInterface) { await queryInterface.removeColumn("file_operations", "deletedAt"); - } + }, }; diff --git a/server/migrations/20231101021239-share-domain.js b/server/migrations/20231101021239-share-domain.js index 4a8a123414..d83b4a16f2 100644 --- a/server/migrations/20231101021239-share-domain.js +++ b/server/migrations/20231101021239-share-domain.js @@ -1,7 +1,7 @@ -'use strict'; +"use strict"; module.exports = { - async up (queryInterface, Sequelize) { + async up(queryInterface, Sequelize) { await queryInterface.addColumn("shares", "domain", { type: Sequelize.STRING, allowNull: true, @@ -9,7 +9,7 @@ module.exports = { }); }, - async down (queryInterface) { + async down(queryInterface) { await queryInterface.removeColumn("shares", "domain"); - } + }, }; diff --git a/server/migrations/20231111023920-add-source-metadata.js b/server/migrations/20231111023920-add-source-metadata.js index 2e27d932f9..9208e2a288 100644 --- a/server/migrations/20231111023920-add-source-metadata.js +++ b/server/migrations/20231111023920-add-source-metadata.js @@ -1,14 +1,14 @@ -'use strict'; +"use strict"; module.exports = { - async up (queryInterface, Sequelize) { + async up(queryInterface, Sequelize) { await queryInterface.addColumn("documents", "sourceMetadata", { type: Sequelize.JSONB, allowNull: true, }); }, - async down (queryInterface) { + async down(queryInterface) { await queryInterface.removeColumn("documents", "sourceMetadata"); - } + }, }; diff --git a/server/migrations/20231118195149-add-content-to-documents.js b/server/migrations/20231118195149-add-content-to-documents.js index 5b74caf249..35d960a41d 100644 --- a/server/migrations/20231118195149-add-content-to-documents.js +++ b/server/migrations/20231118195149-add-content-to-documents.js @@ -1,7 +1,7 @@ -'use strict'; +"use strict"; module.exports = { - async up (queryInterface, Sequelize) { + async up(queryInterface, Sequelize) { await queryInterface.addColumn("documents", "content", { type: Sequelize.JSONB, allowNull: true, @@ -12,8 +12,8 @@ module.exports = { }); }, - async down (queryInterface) { + async down(queryInterface) { await queryInterface.removeColumn("revisions", "content"); await queryInterface.removeColumn("documents", "content"); - } + }, }; diff --git a/server/migrations/20231129011114-cascade-delete.js b/server/migrations/20231129011114-cascade-delete.js index f4a802f360..0f6f1798af 100644 --- a/server/migrations/20231129011114-cascade-delete.js +++ b/server/migrations/20231129011114-cascade-delete.js @@ -1,8 +1,11 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { - await queryInterface.removeConstraint("webhook_subscriptions", "webhook_subscriptions_createdById_fkey") + await queryInterface.removeConstraint( + "webhook_subscriptions", + "webhook_subscriptions_createdById_fkey" + ); await queryInterface.changeColumn("webhook_subscriptions", "createdById", { type: Sequelize.UUID, onDelete: "cascade", @@ -13,12 +16,15 @@ module.exports = { }, down: async (queryInterface, Sequelize) => { - await queryInterface.removeConstraint("webhook_subscriptions", "webhook_subscriptions_createdById_fkey") + await queryInterface.removeConstraint( + "webhook_subscriptions", + "webhook_subscriptions_createdById_fkey" + ); await queryInterface.changeColumn("webhook_subscriptions", "createdById", { type: Sequelize.UUID, references: { model: "users", }, }); - } + }, }; diff --git a/server/migrations/20240113143315-user-permission-source-id.js b/server/migrations/20240113143315-user-permission-source-id.js index 6815dd38d9..cca5cd348a 100644 --- a/server/migrations/20240113143315-user-permission-source-id.js +++ b/server/migrations/20240113143315-user-permission-source-id.js @@ -11,7 +11,10 @@ module.exports = { allowNull: true, }); - await queryInterface.removeConstraint("user_permissions", "user_permissions_documentId_fkey") + await queryInterface.removeConstraint( + "user_permissions", + "user_permissions_documentId_fkey" + ); await queryInterface.changeColumn("user_permissions", "documentId", { type: Sequelize.UUID, onDelete: "cascade", @@ -21,7 +24,10 @@ module.exports = { }); }, async down(queryInterface) { - await queryInterface.removeConstraint("user_permissions", "user_permissions_documentId_fkey") + await queryInterface.removeConstraint( + "user_permissions", + "user_permissions_documentId_fkey" + ); await queryInterface.changeColumn("user_permissions", "documentId", { type: Sequelize.UUID, references: { diff --git a/server/migrations/20240121172253-add-missing-cascades.js b/server/migrations/20240121172253-add-missing-cascades.js index 9bb541dfe1..69e5e9a942 100644 --- a/server/migrations/20240121172253-add-missing-cascades.js +++ b/server/migrations/20240121172253-add-missing-cascades.js @@ -1,8 +1,11 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { - await queryInterface.removeConstraint("comments", "comments_createdById_fkey") + await queryInterface.removeConstraint( + "comments", + "comments_createdById_fkey" + ); await queryInterface.changeColumn("comments", "createdById", { type: Sequelize.UUID, onDelete: "cascade", @@ -11,7 +14,10 @@ module.exports = { }, }); - await queryInterface.removeConstraint("comments", "comments_resolvedById_fkey") + await queryInterface.removeConstraint( + "comments", + "comments_resolvedById_fkey" + ); await queryInterface.changeColumn("comments", "resolvedById", { type: Sequelize.UUID, onDelete: "set null", @@ -22,7 +28,10 @@ module.exports = { }, down: async (queryInterface, Sequelize) => { - await queryInterface.removeConstraint("comments", "comments_resolvedById_fkey") + await queryInterface.removeConstraint( + "comments", + "comments_resolvedById_fkey" + ); await queryInterface.changeColumn("comments", "resolvedById", { type: Sequelize.UUID, references: { @@ -30,12 +39,15 @@ module.exports = { }, }); - await queryInterface.removeConstraint("comments", "comments_createdById_fkey") + await queryInterface.removeConstraint( + "comments", + "comments_createdById_fkey" + ); await queryInterface.changeColumn("comments", "createdById", { type: Sequelize.UUID, references: { model: "users", }, }); - } + }, }; diff --git a/server/migrations/20240204171556-add-event-changeset.js b/server/migrations/20240204171556-add-event-changeset.js index 288987506b..a1ee8ec995 100644 --- a/server/migrations/20240204171556-add-event-changeset.js +++ b/server/migrations/20240204171556-add-event-changeset.js @@ -6,7 +6,6 @@ module.exports = { type: Sequelize.JSONB, allowNull: true, }); - }, async down(queryInterface) { await queryInterface.removeColumn("events", "changes"); diff --git a/server/migrations/20240229034214-search-query-relationship.js b/server/migrations/20240229034214-search-query-relationship.js index 7b8111122e..474a8191e8 100644 --- a/server/migrations/20240229034214-search-query-relationship.js +++ b/server/migrations/20240229034214-search-query-relationship.js @@ -1,8 +1,11 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { - await queryInterface.removeConstraint("search_queries", "search_queries_shareId_fkey") + await queryInterface.removeConstraint( + "search_queries", + "search_queries_shareId_fkey" + ); await queryInterface.changeColumn("search_queries", "shareId", { type: Sequelize.UUID, allowNull: true, @@ -14,7 +17,10 @@ module.exports = { }, down: async (queryInterface, Sequelize) => { - await queryInterface.removeConstraint("search_queries", "search_queries_shareId_fkey") + await queryInterface.removeConstraint( + "search_queries", + "search_queries_shareId_fkey" + ); await queryInterface.changeColumn("search_queries", "shareId", { type: Sequelize.UUID, allowNull: true, @@ -22,5 +28,5 @@ module.exports = { model: "shares", }, }); - } + }, }; diff --git a/server/migrations/20240317171826-add-authentication-refresh-token.js b/server/migrations/20240317171826-add-authentication-refresh-token.js index 53d6169b42..8eddb37eae 100644 --- a/server/migrations/20240317171826-add-authentication-refresh-token.js +++ b/server/migrations/20240317171826-add-authentication-refresh-token.js @@ -1,14 +1,14 @@ -'use strict'; +"use strict"; module.exports = { - async up (queryInterface, Sequelize) { + async up(queryInterface, Sequelize) { await queryInterface.addColumn("authentications", "refreshToken", { type: Sequelize.BLOB, allowNull: true, }); }, - async down (queryInterface) { + async down(queryInterface) { await queryInterface.removeColumn("authentications", "refreshToken"); - } -}; \ No newline at end of file + }, +}; diff --git a/server/migrations/20240319230356-fix-user-permissions-createdby-constraint.js b/server/migrations/20240319230356-fix-user-permissions-createdby-constraint.js index 23fc723ec3..4120d87f9a 100644 --- a/server/migrations/20240319230356-fix-user-permissions-createdby-constraint.js +++ b/server/migrations/20240319230356-fix-user-permissions-createdby-constraint.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; /** @type {import('sequelize-cli').Migration} */ module.exports = { @@ -42,5 +42,5 @@ module.exports = { transaction, }); }); - } + }, }; diff --git a/server/migrations/20240327015248-add-user-role.js b/server/migrations/20240327015248-add-user-role.js index 68e2466307..371e559ede 100644 --- a/server/migrations/20240327015248-add-user-role.js +++ b/server/migrations/20240327015248-add-user-role.js @@ -1,7 +1,7 @@ -'use strict'; +"use strict"; module.exports = { - async up (queryInterface, Sequelize) { + async up(queryInterface, Sequelize) { await queryInterface.addColumn("users", "role", { type: Sequelize.ENUM("admin", "member", "viewer", "guest"), allowNull: true, @@ -35,7 +35,7 @@ module.exports = { }); }, - async down (queryInterface) { + async down(queryInterface) { await queryInterface.removeColumn("users", "role"); - } -}; \ No newline at end of file + }, +}; diff --git a/server/migrations/20240327235446-role-non-nullable.js b/server/migrations/20240327235446-role-non-nullable.js index a61504c641..d758462b0a 100644 --- a/server/migrations/20240327235446-role-non-nullable.js +++ b/server/migrations/20240327235446-role-non-nullable.js @@ -1,15 +1,15 @@ -'use strict'; +"use strict"; module.exports = { - async up (queryInterface, Sequelize) { + async up(queryInterface, Sequelize) { await queryInterface.sequelize.query( - 'ALTER TABLE users ALTER COLUMN role SET NOT NULL;' + "ALTER TABLE users ALTER COLUMN role SET NOT NULL;" ); }, - async down (queryInterface) { + async down(queryInterface) { await queryInterface.sequelize.query( - 'ALTER TABLE users ALTER COLUMN role DROP NOT NULL;' + "ALTER TABLE users ALTER COLUMN role DROP NOT NULL;" ); - } -}; \ No newline at end of file + }, +}; diff --git a/server/migrations/20240329012958-remove-old-role-columns.js b/server/migrations/20240329012958-remove-old-role-columns.js index 270b52b9b3..8bf6f4c29d 100644 --- a/server/migrations/20240329012958-remove-old-role-columns.js +++ b/server/migrations/20240329012958-remove-old-role-columns.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; module.exports = { async up(queryInterface) { @@ -38,5 +38,5 @@ module.exports = { } ); }); - } -}; \ No newline at end of file + }, +}; diff --git a/server/migrations/20240617151506-add-icon-to-document.js b/server/migrations/20240617151506-add-icon-to-document.js index d4f2870600..c41a0d6806 100644 --- a/server/migrations/20240617151506-add-icon-to-document.js +++ b/server/migrations/20240617151506-add-icon-to-document.js @@ -3,7 +3,7 @@ /** @type {import('sequelize-cli').Migration} */ module.exports = { async up(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.addColumn( "documents", "icon", @@ -69,7 +69,7 @@ module.exports = { }, async down(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.removeColumn("documents", "icon", { transaction }); await queryInterface.removeColumn("revisions", "icon", { transaction }); await queryInterface.removeColumn("documents", "color", { transaction }); diff --git a/server/migrations/20240625051656-remove-emoji-column.js b/server/migrations/20240625051656-remove-emoji-column.js index 9144e41098..acc3ac0b7e 100644 --- a/server/migrations/20240625051656-remove-emoji-column.js +++ b/server/migrations/20240625051656-remove-emoji-column.js @@ -3,14 +3,14 @@ /** @type {import('sequelize-cli').Migration} */ module.exports = { async up(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.removeColumn("documents", "emoji", { transaction }); await queryInterface.removeColumn("revisions", "emoji", { transaction }); }); }, async down(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.addColumn( "documents", "emoji", diff --git a/server/migrations/20240709031512-group-permission-source-id.js b/server/migrations/20240709031512-group-permission-source-id.js index 010f1b5b7a..2ac37a3ae7 100644 --- a/server/migrations/20240709031512-group-permission-source-id.js +++ b/server/migrations/20240709031512-group-permission-source-id.js @@ -11,7 +11,10 @@ module.exports = { allowNull: true, }); - await queryInterface.removeConstraint("group_permissions", "group_permissions_documentId_fkey") + await queryInterface.removeConstraint( + "group_permissions", + "group_permissions_documentId_fkey" + ); await queryInterface.changeColumn("group_permissions", "documentId", { type: Sequelize.UUID, onDelete: "cascade", @@ -21,7 +24,10 @@ module.exports = { }); }, async down(queryInterface) { - await queryInterface.removeConstraint("group_permissions", "group_permissions_documentId_fkey") + await queryInterface.removeConstraint( + "group_permissions", + "group_permissions_documentId_fkey" + ); await queryInterface.changeColumn("group_permissions", "documentId", { type: Sequelize.UUID, references: { diff --git a/server/migrations/20240806080954-group-users-paranoid.js b/server/migrations/20240806080954-group-users-paranoid.js index 01247ec134..6f61c7d196 100644 --- a/server/migrations/20240806080954-group-users-paranoid.js +++ b/server/migrations/20240806080954-group-users-paranoid.js @@ -1,14 +1,14 @@ -'use strict'; +"use strict"; /** @type {import('sequelize-cli').Migration} */ module.exports = { - async up (queryInterface) { + async up(queryInterface) { await queryInterface.sequelize.query( `DELETE FROM group_users WHERE "deletedAt" IS NOT NULL` ); }, - async down () { + async down() { // No reverting possible - } + }, }; diff --git a/server/migrations/20240810080954-group-users-remove-deleted-at.js b/server/migrations/20240810080954-group-users-remove-deleted-at.js index 4a86c2b94a..8217f28c59 100644 --- a/server/migrations/20240810080954-group-users-remove-deleted-at.js +++ b/server/migrations/20240810080954-group-users-remove-deleted-at.js @@ -1,9 +1,9 @@ -'use strict'; +"use strict"; /** @type {import('sequelize-cli').Migration} */ module.exports = { - async up (queryInterface) { - await queryInterface.removeColumn('group_users', 'deletedAt'); + async up(queryInterface) { + await queryInterface.removeColumn("group_users", "deletedAt"); // Cleanup any rows with duplicate groupId + userId await queryInterface.sequelize.query(` @@ -16,21 +16,24 @@ module.exports = { `); // Add groupId + userId as primary key - await queryInterface.addConstraint('group_users', { - fields: ['groupId', 'userId'], - type: 'primary key', - name: 'group_users_pkey' + await queryInterface.addConstraint("group_users", { + fields: ["groupId", "userId"], + type: "primary key", + name: "group_users_pkey", }); - await queryInterface.removeIndex("group_users", "group_users_group_id_user_id"); + await queryInterface.removeIndex( + "group_users", + "group_users_group_id_user_id" + ); }, - async down (queryInterface, Sequelize) { + async down(queryInterface, Sequelize) { await queryInterface.addIndex("group_users", ["groupId", "userId"]); - await queryInterface.removeConstraint('group_users', 'group_users_pkey'); - await queryInterface.addColumn('group_users', 'deletedAt', { + await queryInterface.removeConstraint("group_users", "group_users_pkey"); + await queryInterface.addColumn("group_users", "deletedAt", { type: Sequelize.DATE, - allowNull: true + allowNull: true, }); - } + }, }; diff --git a/server/migrations/20240821001616-add-notifications-index.js b/server/migrations/20240821001616-add-notifications-index.js index 8577598f41..684cf14c4c 100644 --- a/server/migrations/20240821001616-add-notifications-index.js +++ b/server/migrations/20240821001616-add-notifications-index.js @@ -1,12 +1,12 @@ -'use strict'; +"use strict"; /** @type {import('sequelize-cli').Migration} */ module.exports = { - async up (queryInterface, Sequelize) { - await queryInterface.addIndex('notifications', ['teamId', 'userId']); + async up(queryInterface, Sequelize) { + await queryInterface.addIndex("notifications", ["teamId", "userId"]); }, - async down (queryInterface, Sequelize) { - await queryInterface.removeIndex('notifications', ['teamId', 'userId']); - } + async down(queryInterface, Sequelize) { + await queryInterface.removeIndex("notifications", ["teamId", "userId"]); + }, }; diff --git a/server/migrations/20240821002344-add-user-permission-index.js b/server/migrations/20240821002344-add-user-permission-index.js index 9643deb37e..e98fd3375c 100644 --- a/server/migrations/20240821002344-add-user-permission-index.js +++ b/server/migrations/20240821002344-add-user-permission-index.js @@ -1,12 +1,15 @@ -'use strict'; +"use strict"; /** @type {import('sequelize-cli').Migration} */ module.exports = { - async up (queryInterface, Sequelize) { - await queryInterface.addIndex('user_permissions', ['documentId', 'userId']); + async up(queryInterface, Sequelize) { + await queryInterface.addIndex("user_permissions", ["documentId", "userId"]); }, - async down (queryInterface, Sequelize) { - await queryInterface.removeIndex('user_permissions', ['documentId', 'userId']); - } + async down(queryInterface, Sequelize) { + await queryInterface.removeIndex("user_permissions", [ + "documentId", + "userId", + ]); + }, }; diff --git a/server/migrations/20240821002502-add-user-authentication-index.js b/server/migrations/20240821002502-add-user-authentication-index.js index 8226e96c3a..3685551312 100644 --- a/server/migrations/20240821002502-add-user-authentication-index.js +++ b/server/migrations/20240821002502-add-user-authentication-index.js @@ -1,12 +1,12 @@ -'use strict'; +"use strict"; /** @type {import('sequelize-cli').Migration} */ module.exports = { - async up (queryInterface, Sequelize) { - await queryInterface.addIndex('user_authentications', ['userId']); + async up(queryInterface, Sequelize) { + await queryInterface.addIndex("user_authentications", ["userId"]); }, - async down (queryInterface, Sequelize) { - await queryInterface.removeIndex('user_authentications', ['userId']); - } + async down(queryInterface, Sequelize) { + await queryInterface.removeIndex("user_authentications", ["userId"]); + }, }; diff --git a/server/migrations/20240929194201-add-hash-to-api-key.js b/server/migrations/20240929194201-add-hash-to-api-key.js index 82b2c321c1..babc77385d 100644 --- a/server/migrations/20240929194201-add-hash-to-api-key.js +++ b/server/migrations/20240929194201-add-hash-to-api-key.js @@ -1,35 +1,55 @@ -'use strict'; +"use strict"; /** @type {import('sequelize-cli').Migration} */ module.exports = { - async up (queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { - await queryInterface.addColumn("apiKeys", "hash", { - type: Sequelize.STRING, - allowNull: true, - unique: true, - }, { transaction }); + async up(queryInterface, Sequelize) { + await queryInterface.sequelize.transaction(async (transaction) => { + await queryInterface.addColumn( + "apiKeys", + "hash", + { + type: Sequelize.STRING, + allowNull: true, + unique: true, + }, + { transaction } + ); - await queryInterface.addColumn("apiKeys", "last4", { - type: Sequelize.STRING(4), - allowNull: true, - }, { transaction }); + await queryInterface.addColumn( + "apiKeys", + "last4", + { + type: Sequelize.STRING(4), + allowNull: true, + }, + { transaction } + ); - await queryInterface.changeColumn("apiKeys", "secret", { - type: Sequelize.STRING, - allowNull: true, - }, { transaction }); + await queryInterface.changeColumn( + "apiKeys", + "secret", + { + type: Sequelize.STRING, + allowNull: true, + }, + { transaction } + ); }); }, - async down (queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { + async down(queryInterface, Sequelize) { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.removeColumn("apiKeys", "hash", { transaction }); await queryInterface.removeColumn("apiKeys", "last4", { transaction }); - await queryInterface.changeColumn("apiKeys", "secret", { - type: Sequelize.STRING, - allowNull: false, - }, { transaction }); + await queryInterface.changeColumn( + "apiKeys", + "secret", + { + type: Sequelize.STRING, + allowNull: false, + }, + { transaction } + ); }); - } + }, }; diff --git a/server/migrations/20241013080608-create-reactions.js b/server/migrations/20241013080608-create-reactions.js index 8a1288bd14..407076fb32 100644 --- a/server/migrations/20241013080608-create-reactions.js +++ b/server/migrations/20241013080608-create-reactions.js @@ -3,7 +3,7 @@ /** @type {import('sequelize-cli').Migration} */ module.exports = { async up(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.createTable( "reactions", { @@ -64,7 +64,7 @@ module.exports = { }, async down(queryInterface, Sequelize) { - queryInterface.sequelize.transaction(async transaction => { + queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.dropTable("reactions", { transaction }); await queryInterface.removeColumn("comments", "reactions", { transaction, diff --git a/server/migrations/20241127151705-attachment-tracking.js b/server/migrations/20241127151705-attachment-tracking.js index 2ada3411b7..833c944bc2 100644 --- a/server/migrations/20241127151705-attachment-tracking.js +++ b/server/migrations/20241127151705-attachment-tracking.js @@ -3,19 +3,32 @@ /** @type {import('sequelize-cli').Migration} */ module.exports = { async up(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { - await queryInterface.addColumn("teams", "approximateTotalAttachmentsSize", { - type: Sequelize.BIGINT, - defaultValue: 0, - }, { transaction }); - await queryInterface.addIndex("attachments", ["createdAt"], { transaction }); + await queryInterface.sequelize.transaction(async (transaction) => { + await queryInterface.addColumn( + "teams", + "approximateTotalAttachmentsSize", + { + type: Sequelize.BIGINT, + defaultValue: 0, + }, + { transaction } + ); + await queryInterface.addIndex("attachments", ["createdAt"], { + transaction, + }); }); }, async down(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { - await queryInterface.removeIndex("attachments", ["createdAt"], { transaction }); - await queryInterface.removeColumn("teams", "approximateTotalAttachmentsSize", { transaction }); + await queryInterface.sequelize.transaction(async (transaction) => { + await queryInterface.removeIndex("attachments", ["createdAt"], { + transaction, + }); + await queryInterface.removeColumn( + "teams", + "approximateTotalAttachmentsSize", + { transaction } + ); }); }, }; diff --git a/server/migrations/20241219023150-group-external-id.js b/server/migrations/20241219023150-group-external-id.js index b4f239a203..2f047b5eec 100644 --- a/server/migrations/20241219023150-group-external-id.js +++ b/server/migrations/20241219023150-group-external-id.js @@ -3,22 +3,39 @@ /** @type {import('sequelize-cli').Migration} */ module.exports = { async up(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { - await queryInterface.addColumn("groups", "externalId", { - type: Sequelize.STRING, - }, { transaction }); + await queryInterface.sequelize.transaction(async (transaction) => { + await queryInterface.addColumn( + "groups", + "externalId", + { + type: Sequelize.STRING, + }, + { transaction } + ); await queryInterface.addIndex("groups", ["externalId"], { transaction }); - await queryInterface.addIndex("group_permissions", ["documentId"], { transaction }); - await queryInterface.addIndex("group_permissions", ["sourceId"], { transaction }); + await queryInterface.addIndex("group_permissions", ["documentId"], { + transaction, + }); + await queryInterface.addIndex("group_permissions", ["sourceId"], { + transaction, + }); }); }, async down(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { - await queryInterface.removeIndex("group_permissions", ["sourceId"], { transaction }); - await queryInterface.removeIndex("group_permissions", ["documentId"], { transaction }); - await queryInterface.removeIndex("groups", ["externalId"], { transaction }); - await queryInterface.removeColumn("groups", "externalId", { transaction }); + await queryInterface.sequelize.transaction(async (transaction) => { + await queryInterface.removeIndex("group_permissions", ["sourceId"], { + transaction, + }); + await queryInterface.removeIndex("group_permissions", ["documentId"], { + transaction, + }); + await queryInterface.removeIndex("groups", ["externalId"], { + transaction, + }); + await queryInterface.removeColumn("groups", "externalId", { + transaction, + }); }); }, }; diff --git a/server/migrations/20250125031823-add-api-key-scopes.js b/server/migrations/20250125031823-add-api-key-scopes.js index f1f9a6d180..40067ceee8 100644 --- a/server/migrations/20250125031823-add-api-key-scopes.js +++ b/server/migrations/20250125031823-add-api-key-scopes.js @@ -3,16 +3,21 @@ /** @type {import('sequelize-cli').Migration} */ module.exports = { async up(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { - await queryInterface.addColumn("apiKeys", "scope", { - type: Sequelize.ARRAY(Sequelize.STRING), - allowNull: true, - }, { transaction }); + await queryInterface.sequelize.transaction(async (transaction) => { + await queryInterface.addColumn( + "apiKeys", + "scope", + { + type: Sequelize.ARRAY(Sequelize.STRING), + allowNull: true, + }, + { transaction } + ); }); }, async down(queryInterface) { - await queryInterface.sequelize.transaction(async transaction => { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.removeColumn("apiKeys", "scope", { transaction }); }); }, diff --git a/server/migrations/20250207120103-add-collectionId-to-subscriptions.js b/server/migrations/20250207120103-add-collectionId-to-subscriptions.js index 9291a1cf45..3cb3d5b7e0 100644 --- a/server/migrations/20250207120103-add-collectionId-to-subscriptions.js +++ b/server/migrations/20250207120103-add-collectionId-to-subscriptions.js @@ -3,7 +3,7 @@ /** @type {import('sequelize-cli').Migration} */ module.exports = { async up(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.addColumn( "subscriptions", "collectionId", @@ -30,7 +30,7 @@ module.exports = { }, async down(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.removeIndex( "subscriptions", ["userId", "collectionId", "event"], diff --git a/server/migrations/20250217012609-document-title-index.js b/server/migrations/20250217012609-document-title-index.js index 082b681b65..68bd5a46ec 100644 --- a/server/migrations/20250217012609-document-title-index.js +++ b/server/migrations/20250217012609-document-title-index.js @@ -1,19 +1,19 @@ -'use strict'; +"use strict"; /** @type {import('sequelize-cli').Migration} */ module.exports = { -async up (queryInterface) { + async up(queryInterface) { await queryInterface.sequelize.query( - `CREATE EXTENSION IF NOT EXISTS "pg_trgm";`, + `CREATE EXTENSION IF NOT EXISTS "pg_trgm";` ); await queryInterface.sequelize.query( - `CREATE INDEX CONCURRENTLY documents_title_idx ON documents USING GIN (title gin_trgm_ops);`, + `CREATE INDEX CONCURRENTLY documents_title_idx ON documents USING GIN (title gin_trgm_ops);` ); }, - async down (queryInterface) { + async down(queryInterface) { await queryInterface.sequelize.query( - `DROP INDEX CONCURRENTLY documents_title_idx;`, + `DROP INDEX CONCURRENTLY documents_title_idx;` ); - } + }, }; diff --git a/server/migrations/20250217230810-add-team-previous-subdomains.js b/server/migrations/20250217230810-add-team-previous-subdomains.js index 898348bc66..64e9dcdb96 100644 --- a/server/migrations/20250217230810-add-team-previous-subdomains.js +++ b/server/migrations/20250217230810-add-team-previous-subdomains.js @@ -3,11 +3,16 @@ /** @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.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 } @@ -16,12 +21,14 @@ module.exports = { }, async down(queryInterface) { - await queryInterface.sequelize.transaction(async transaction => { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.sequelize.query( `DROP INDEX teams_previous_subdomains;`, { transaction } ); - await queryInterface.removeColumn("teams", "previousSubdomains", { transaction }); + await queryInterface.removeColumn("teams", "previousSubdomains", { + transaction, + }); }); }, }; diff --git a/server/migrations/20250223142558-cascade-team-domain.js b/server/migrations/20250223142558-cascade-team-domain.js index d9be917340..828224568e 100644 --- a/server/migrations/20250223142558-cascade-team-domain.js +++ b/server/migrations/20250223142558-cascade-team-domain.js @@ -4,7 +4,7 @@ const tableName = "team_domains"; const constraintNames = [ "team_domains_createdById_fkey", - "createdById_foreign_idx" + "createdById_foreign_idx", ]; module.exports = { diff --git a/server/migrations/20250306181804-create-imports.js b/server/migrations/20250306181804-create-imports.js index eeb751534f..e8517e34ff 100644 --- a/server/migrations/20250306181804-create-imports.js +++ b/server/migrations/20250306181804-create-imports.js @@ -3,7 +3,7 @@ /** @type {import('sequelize-cli').Migration} */ module.exports = { async up(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.createTable( "imports", { @@ -80,7 +80,7 @@ module.exports = { }, async down(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.removeIndex("imports", ["service", "teamId"], { transaction, }); diff --git a/server/migrations/20250310043011-create-import-tasks.js b/server/migrations/20250310043011-create-import-tasks.js index f14c5f7fd1..9c889129bd 100644 --- a/server/migrations/20250310043011-create-import-tasks.js +++ b/server/migrations/20250310043011-create-import-tasks.js @@ -3,7 +3,7 @@ /** @type {import('sequelize-cli').Migration} */ module.exports = { async up(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.createTable( "import_tasks", { @@ -54,7 +54,7 @@ module.exports = { }, async down(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.removeIndex("import_tasks", ["importId"], { transaction, }); diff --git a/server/migrations/20250314105847-add-apiImportId-to-collections-and-documents.js b/server/migrations/20250314105847-add-apiImportId-to-collections-and-documents.js index 3cc886dac3..fd9f7f79f8 100644 --- a/server/migrations/20250314105847-add-apiImportId-to-collections-and-documents.js +++ b/server/migrations/20250314105847-add-apiImportId-to-collections-and-documents.js @@ -3,7 +3,7 @@ /** @type {import('sequelize-cli').Migration} */ module.exports = { async up(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.addColumn( "collections", "apiImportId", @@ -39,7 +39,7 @@ module.exports = { }, async down(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.removeIndex("collections", [ "apiImportId", { transaction }, diff --git a/server/migrations/20250327110739-add-error-to-imports.js b/server/migrations/20250327110739-add-error-to-imports.js index f675de665d..25370e5fad 100644 --- a/server/migrations/20250327110739-add-error-to-imports.js +++ b/server/migrations/20250327110739-add-error-to-imports.js @@ -3,7 +3,7 @@ /** @type {import('sequelize-cli').Migration} */ module.exports = { async up(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.addColumn( "imports", "error", @@ -27,7 +27,7 @@ module.exports = { }, async down(queryInterface, Sequelize) { - await queryInterface.sequelize.transaction(async transaction => { + await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.removeColumn("imports", "error", { transaction }); await queryInterface.removeColumn("import_tasks", "error", { transaction, diff --git a/server/migrations/20250331231413-add-oauth-server-models.js b/server/migrations/20250331231413-add-oauth-server-models.js index f8af70ed96..8f79392d3c 100644 --- a/server/migrations/20250331231413-add-oauth-server-models.js +++ b/server/migrations/20250331231413-add-oauth-server-models.js @@ -4,209 +4,225 @@ module.exports = { async up(queryInterface, Sequelize) { await queryInterface.sequelize.transaction(async (transaction) => { - await queryInterface.createTable("oauth_clients", { - id: { - type: Sequelize.UUID, - primaryKey: true, - allowNull: false - }, - name: { - type: Sequelize.STRING, - allowNull: false - }, - description: { - type: Sequelize.STRING, - allowNull: true - }, - developerName: { - type: Sequelize.STRING, - allowNull: true - }, - developerUrl: { - type: Sequelize.STRING, - allowNull: true - }, - avatarUrl: { - type: Sequelize.STRING, - allowNull: true - }, - clientId: { - type: Sequelize.STRING, - allowNull: false, - unique: true, - }, - clientSecret: { - type: Sequelize.BLOB, - allowNull: false - }, - published: { - type: Sequelize.BOOLEAN, - allowNull: false, - defaultValue: false - }, - teamId: { - type: Sequelize.UUID, - references: { - model: "teams", + await queryInterface.createTable( + "oauth_clients", + { + id: { + type: Sequelize.UUID, + primaryKey: true, + allowNull: false, }, - allowNull: false, - onDelete: "cascade" - }, - createdById: { - type: Sequelize.UUID, - references: { - model: "users", + name: { + type: Sequelize.STRING, + allowNull: false, + }, + description: { + type: Sequelize.STRING, + allowNull: true, + }, + developerName: { + type: Sequelize.STRING, + allowNull: true, + }, + developerUrl: { + type: Sequelize.STRING, + allowNull: true, + }, + avatarUrl: { + type: Sequelize.STRING, + allowNull: true, + }, + clientId: { + type: Sequelize.STRING, + allowNull: false, + unique: true, + }, + clientSecret: { + type: Sequelize.BLOB, + allowNull: false, + }, + published: { + type: Sequelize.BOOLEAN, + allowNull: false, + defaultValue: false, + }, + teamId: { + type: Sequelize.UUID, + references: { + model: "teams", + }, + allowNull: false, + onDelete: "cascade", + }, + createdById: { + type: Sequelize.UUID, + references: { + model: "users", + }, + allowNull: false, + }, + redirectUris: { + type: Sequelize.ARRAY(Sequelize.STRING), + allowNull: false, + defaultValue: [], + }, + createdAt: { + type: Sequelize.DATE, + allowNull: false, + }, + updatedAt: { + type: Sequelize.DATE, + allowNull: false, + }, + deletedAt: { + type: Sequelize.DATE, + allowNull: true, }, - allowNull: false }, - redirectUris: { - type: Sequelize.ARRAY(Sequelize.STRING), - allowNull: false, - defaultValue: [] - }, - createdAt: { - type: Sequelize.DATE, - allowNull: false - }, - updatedAt: { - type: Sequelize.DATE, - allowNull: false - }, - deletedAt: { - type: Sequelize.DATE, - allowNull: true + { + transaction, } - }, { - transaction - }); + ); - await queryInterface.createTable("oauth_authorization_codes", { - id: { - type: Sequelize.UUID, - primaryKey: true, - allowNull: false - }, - authorizationCodeHash: { - type: Sequelize.STRING, - allowNull: false - }, - codeChallenge: { - type: Sequelize.STRING, - allowNull: true - }, - codeChallengeMethod: { - type: Sequelize.STRING, - allowNull: true - }, - scope: { - type: Sequelize.ARRAY(Sequelize.STRING), - allowNull: false - }, - oauthClientId: { - type: Sequelize.UUID, - references: { - model: "oauth_clients", + await queryInterface.createTable( + "oauth_authorization_codes", + { + id: { + type: Sequelize.UUID, + primaryKey: true, + allowNull: false, }, - onDelete: "cascade", - allowNull: false - }, - userId: { - type: Sequelize.UUID, - references: { - model: "users", + authorizationCodeHash: { + type: Sequelize.STRING, + allowNull: false, + }, + codeChallenge: { + type: Sequelize.STRING, + allowNull: true, + }, + codeChallengeMethod: { + type: Sequelize.STRING, + allowNull: true, + }, + scope: { + type: Sequelize.ARRAY(Sequelize.STRING), + allowNull: false, + }, + oauthClientId: { + type: Sequelize.UUID, + references: { + model: "oauth_clients", + }, + onDelete: "cascade", + allowNull: false, + }, + userId: { + type: Sequelize.UUID, + references: { + model: "users", + }, + onDelete: "cascade", + allowNull: false, + }, + redirectUri: { + type: Sequelize.STRING, + allowNull: false, + }, + expiresAt: { + type: Sequelize.DATE, + allowNull: false, + }, + createdAt: { + type: Sequelize.DATE, + allowNull: false, }, - onDelete: "cascade", - allowNull: false }, - redirectUri: { - type: Sequelize.STRING, - allowNull: false - }, - expiresAt: { - type: Sequelize.DATE, - allowNull: false - }, - createdAt: { - type: Sequelize.DATE, - allowNull: false + { + transaction, } - }, { - transaction - }); + ); - await queryInterface.createTable("oauth_authentications", { - id: { - type: Sequelize.UUID, - primaryKey: true, - allowNull: false - }, - accessTokenHash: { - type: Sequelize.STRING, - allowNull: false, - unique: true - }, - accessTokenExpiresAt: { - type: Sequelize.DATE, - allowNull: false - }, - refreshTokenHash: { - type: Sequelize.STRING, - allowNull: false, - unique: true - }, - refreshTokenExpiresAt: { - type: Sequelize.DATE, - allowNull: false - }, - lastActiveAt: { - type: Sequelize.DATE, - allowNull: true - }, - scope: { - type: Sequelize.ARRAY(Sequelize.STRING), - allowNull: false - }, - oauthClientId: { - type: Sequelize.UUID, - references: { - model: "oauth_clients", + await queryInterface.createTable( + "oauth_authentications", + { + id: { + type: Sequelize.UUID, + primaryKey: true, + allowNull: false, }, - onDelete: "cascade", - allowNull: false - }, - userId: { - type: Sequelize.UUID, - references: { - model: "users", + accessTokenHash: { + type: Sequelize.STRING, + allowNull: false, + unique: true, + }, + accessTokenExpiresAt: { + type: Sequelize.DATE, + allowNull: false, + }, + refreshTokenHash: { + type: Sequelize.STRING, + allowNull: false, + unique: true, + }, + refreshTokenExpiresAt: { + type: Sequelize.DATE, + allowNull: false, + }, + lastActiveAt: { + type: Sequelize.DATE, + allowNull: true, + }, + scope: { + type: Sequelize.ARRAY(Sequelize.STRING), + allowNull: false, + }, + oauthClientId: { + type: Sequelize.UUID, + references: { + model: "oauth_clients", + }, + onDelete: "cascade", + allowNull: false, + }, + userId: { + type: Sequelize.UUID, + references: { + model: "users", + }, + onDelete: "cascade", + allowNull: false, + }, + createdAt: { + type: Sequelize.DATE, + allowNull: false, + }, + updatedAt: { + type: Sequelize.DATE, + allowNull: false, + }, + deletedAt: { + type: Sequelize.DATE, + allowNull: true, }, - onDelete: "cascade", - allowNull: false }, - createdAt: { - type: Sequelize.DATE, - allowNull: false - }, - updatedAt: { - type: Sequelize.DATE, - allowNull: false - }, - deletedAt: { - type: Sequelize.DATE, - allowNull: true + { + transaction, } - }, { - transaction - }); + ); - await queryInterface.addIndex("oauth_clients", ["teamId"], { transaction }); + await queryInterface.addIndex("oauth_clients", ["teamId"], { + transaction, + }); }); }, async down(queryInterface, Sequelize) { await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.dropTable("oauth_authentications", { transaction }); - await queryInterface.dropTable("oauth_authorization_codes", { transaction }); + await queryInterface.dropTable("oauth_authorization_codes", { + transaction, + }); await queryInterface.dropTable("oauth_clients", { transaction }); }); - } + }, }; diff --git a/server/migrations/20250429130521-add-collection-commenting.js b/server/migrations/20250429130521-add-collection-commenting.js index 83847bf00a..eb4935e880 100644 --- a/server/migrations/20250429130521-add-collection-commenting.js +++ b/server/migrations/20250429130521-add-collection-commenting.js @@ -1,17 +1,16 @@ -'use strict'; +"use strict"; /** @type {import('sequelize-cli').Migration} */ module.exports = { - async up (queryInterface, Sequelize) { - await queryInterface.addColumn('collections', 'commenting', { + async up(queryInterface, Sequelize) { + await queryInterface.addColumn("collections", "commenting", { type: Sequelize.BOOLEAN, allowNull: true, defaultValue: null, }); }, - async down (queryInterface, Sequelize) { - await queryInterface.removeColumn('collections', 'commenting'); - } + async down(queryInterface, Sequelize) { + await queryInterface.removeColumn("collections", "commenting"); + }, }; - diff --git a/server/migrations/20250515031645-add-revisions-deleted-at.js b/server/migrations/20250515031645-add-revisions-deleted-at.js index 2310bc9b89..196cd6102d 100644 --- a/server/migrations/20250515031645-add-revisions-deleted-at.js +++ b/server/migrations/20250515031645-add-revisions-deleted-at.js @@ -1,15 +1,15 @@ -'use strict'; +"use strict"; /** @type {import('sequelize-cli').Migration} */ module.exports = { - async up (queryInterface, Sequelize) { + async up(queryInterface, Sequelize) { await queryInterface.addColumn("revisions", "deletedAt", { type: Sequelize.DATE, - allowNull: true + allowNull: true, }); }, - async down (queryInterface, Sequelize) { + async down(queryInterface, Sequelize) { await queryInterface.removeColumn("revisions", "deletedAt"); - } + }, }; diff --git a/server/migrations/20250531002344-add-description-to-teams.js b/server/migrations/20250531002344-add-description-to-teams.js index e97efe2651..4a2ab9418f 100644 --- a/server/migrations/20250531002344-add-description-to-teams.js +++ b/server/migrations/20250531002344-add-description-to-teams.js @@ -1,15 +1,14 @@ -'use strict'; +"use strict"; module.exports = { up: async (queryInterface, Sequelize) => { - await queryInterface.addColumn('teams', 'description', { + await queryInterface.addColumn("teams", "description", { type: Sequelize.TEXT, allowNull: true, }); }, down: async (queryInterface, Sequelize) => { - await queryInterface.removeColumn('teams', 'description'); - } + await queryInterface.removeColumn("teams", "description"); + }, }; - diff --git a/server/migrations/20250531003217-add-show-last-updated-to-shares.js b/server/migrations/20250531003217-add-show-last-updated-to-shares.js index 76cfc9a367..56cc868366 100644 --- a/server/migrations/20250531003217-add-show-last-updated-to-shares.js +++ b/server/migrations/20250531003217-add-show-last-updated-to-shares.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; /** @type {import('sequelize-cli').Migration} */ module.exports = { @@ -12,6 +12,5 @@ module.exports = { async down(queryInterface, Sequelize) { await queryInterface.removeColumn("shares", "showLastUpdated"); - } + }, }; - diff --git a/server/migrations/20250601223331-migrate-backlink-to-relationship.js b/server/migrations/20250601223331-migrate-backlink-to-relationship.js index 036e89a5fe..1216e28814 100644 --- a/server/migrations/20250601223331-migrate-backlink-to-relationship.js +++ b/server/migrations/20250601223331-migrate-backlink-to-relationship.js @@ -1,50 +1,77 @@ -'use strict'; +"use strict"; /** @type {import('sequelize-cli').Migration} */ module.exports = { - async up (queryInterface, Sequelize) { + async up(queryInterface, Sequelize) { await queryInterface.sequelize.transaction(async (transaction) => { // Rename the existing backlinks table to relationships - await queryInterface.renameTable("backlinks", "relationships", { transaction }); + await queryInterface.renameTable("backlinks", "relationships", { + transaction, + }); // Add the type column with default value - await queryInterface.addColumn("relationships", "type", { - type: Sequelize.ENUM('backlink'), - allowNull: false, - defaultValue: 'backlink', - }, { transaction }); + await queryInterface.addColumn( + "relationships", + "type", + { + type: Sequelize.ENUM("backlink"), + allowNull: false, + defaultValue: "backlink", + }, + { transaction } + ); // Add new indexes for performance (the old indexes on documentId and reverseDocumentId should still exist) await queryInterface.addIndex("relationships", ["type"], { transaction }); - await queryInterface.addIndex("relationships", ["documentId", "type"], { transaction }); + await queryInterface.addIndex("relationships", ["documentId", "type"], { + transaction, + }); // Create a view for backward compatibility - await queryInterface.sequelize.query(` + await queryInterface.sequelize.query( + ` CREATE VIEW backlinks AS SELECT id, "userId", "documentId", "reverseDocumentId", "createdAt", "updatedAt" FROM relationships WHERE type = 'backlink'; - `, { transaction }); + `, + { transaction } + ); }); }, - async down (queryInterface, Sequelize) { + async down(queryInterface, Sequelize) { await queryInterface.sequelize.transaction(async (transaction) => { // Drop the view - await queryInterface.sequelize.query('DROP VIEW IF EXISTS backlinks;', { transaction }); - + await queryInterface.sequelize.query("DROP VIEW IF EXISTS backlinks;", { + transaction, + }); + // Remove the type-specific indexes - await queryInterface.removeIndex("relationships", ["type"], { transaction }); - await queryInterface.removeIndex("relationships", ["documentId", "type"], { transaction }); - + await queryInterface.removeIndex("relationships", ["type"], { + transaction, + }); + await queryInterface.removeIndex( + "relationships", + ["documentId", "type"], + { transaction } + ); + // Remove the type column - await queryInterface.removeColumn("relationships", "type", { transaction }); - + await queryInterface.removeColumn("relationships", "type", { + transaction, + }); + // Drop the enum type - await queryInterface.sequelize.query('DROP TYPE IF EXISTS "enum_relationships_type";', { transaction }); - + await queryInterface.sequelize.query( + 'DROP TYPE IF EXISTS "enum_relationships_type";', + { transaction } + ); + // Rename the table back to backlinks - await queryInterface.renameTable("relationships", "backlinks", { transaction }); + await queryInterface.renameTable("relationships", "backlinks", { + transaction, + }); }); - } + }, }; diff --git a/server/migrations/20250630100046-add-oauth-to-search-queries-source.js b/server/migrations/20250630100046-add-oauth-to-search-queries-source.js index adf78a0c1b..234fda5953 100644 --- a/server/migrations/20250630100046-add-oauth-to-search-queries-source.js +++ b/server/migrations/20250630100046-add-oauth-to-search-queries-source.js @@ -1,16 +1,16 @@ -'use strict'; +"use strict"; /** @type {import('sequelize-cli').Migration} */ module.exports = { - async up (queryInterface, Sequelize) { + async up(queryInterface, Sequelize) { await queryInterface.sequelize.query( "ALTER TYPE enum_search_queries_source ADD VALUE 'oauth'" ); }, - async down (queryInterface, Sequelize) { + async down(queryInterface, Sequelize) { // Note: PostgreSQL doesn't support removing enum values easily // This would require recreating the enum type and updating all references - throw new Error('Cannot rollback adding enum value to PostgreSQL'); - } + throw new Error("Cannot rollback adding enum value to PostgreSQL"); + }, }; diff --git a/server/onboarding/Getting Started.md b/server/onboarding/Getting Started.md index 143dffe8a8..9e9604e27c 100644 --- a/server/onboarding/Getting Started.md +++ b/server/onboarding/Getting Started.md @@ -15,5 +15,3 @@ Some ideas to get you and your team started with learning the basics of Outline, - [ ] **Create a template** to share a writing structure with your team - [ ] Create a check list to track tasks - [ ] Try embedding a supported [integration](https://www.getoutline.com/integrations) - - diff --git a/server/onboarding/Integrations & API.md b/server/onboarding/Integrations & API.md index ed87ef6ecc..41462b9adf 100644 --- a/server/onboarding/Integrations & API.md +++ b/server/onboarding/Integrations & API.md @@ -3,14 +3,13 @@ Outline supports many of the most popular tools on the market without any additional settings or configuration. Just paste links to a YouTube video, Figma file, or Google Spreadsheet to get instant live-embeds in your documents. Take a look at the [integrations directory](https://www.getoutline.com/integrations) for a list of all of the tools that are supported. \ -Our integration code is also [open-source](https://github.com/outline/outline) and we encourage third party developers and the community to build support for additional tools! +Our integration code is also [open-source](https://github.com/outline/outline) and we encourage third party developers and the community to build support for additional tools! \ :::info Most integrations work by simply pasting a link from a supported service into a document. ::: - ## Slack If your team is using Slack to communicate then you’ll definitely want to enable our [Slack Integration](/settings/integrations/slack) to get instant link unfurling for Outline documents and access to the `/outline` slash command to search your knowledge base directly from Slack. @@ -28,4 +27,3 @@ curl -XPOST -H "Content-type: application/json" -d '{ "publish": true }' 'https://www.getoutline.com/api/documents.create' ``` - diff --git a/server/onboarding/What is Outline.md b/server/onboarding/What is Outline.md index c88f39986a..d16015ff41 100644 --- a/server/onboarding/What is Outline.md +++ b/server/onboarding/What is Outline.md @@ -1,6 +1,7 @@ Outline is a place to build your team knowledge base, you could think of it like your team’s shared library – a place for important documentation, notes, and ideas to live and be discovered. Some things you might want to keep in Outline include: \ + - Documentation - Support knowledge base - Product plans and RFCs @@ -15,4 +16,4 @@ Outline allows you to organize documents in "collections", for example these cou ## Search -Outline is built from the ground up to be really fast, and that includes [search](/search). You can start searching from anywhere with the `CMD+K` shortcut – then filter by time, author, and more to find the information you need. Or you can search from within Slack with the `/outline` slash command. \ No newline at end of file +Outline is built from the ground up to be really fast, and that includes [search](/search). You can start searching from anywhere with the `CMD+K` shortcut – then filter by time, author, and more to find the information you need. Or you can search from within Slack with the `/outline` slash command. diff --git a/server/static/error.dev.html b/server/static/error.dev.html index cd8eba10cc..665f2edca8 100644 --- a/server/static/error.dev.html +++ b/server/static/error.dev.html @@ -1,4 +1,4 @@ - +