feat: adopt calendar versioning and reset the migration baseline (#6362)

This commit is contained in:
Johnny
2026-09-22 09:03:49 +08:00
committed by GitHub
parent e3d25e18dc
commit fa12d84606
161 changed files with 862 additions and 4759 deletions
-37
View File
@@ -1,37 +0,0 @@
name: Release Please
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
issues: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Check release token
env:
RELEASE_PLEASE_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
run: |
if [ -z "$RELEASE_PLEASE_TOKEN" ]; then
echo "RELEASE_PLEASE_TOKEN must be set to a fine-grained PAT so release-please tags can trigger release.yml." >&2
exit 1
fi
- name: Run release-please
uses: googleapis/release-please-action@v4
with:
# Use a fine-grained PAT so generated tags trigger release.yml.
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
+34 -36
View File
@@ -3,7 +3,9 @@ name: Release
on:
push:
tags:
- "v*.*.*"
# Calendar tags only (26.09, 26.09.1, 26.09-rc.1); legacy v0.x tags
# are rejected by scripts/release_version.sh and must not start a run.
- "[1-9][0-9].*"
workflow_dispatch:
concurrency:
@@ -31,9 +33,17 @@ jobs:
outputs:
version: ${{ steps.version.outputs.version }}
tag: ${{ steps.version.outputs.tag }}
major_minor: ${{ steps.version.outputs.major_minor }}
series: ${{ steps.version.outputs.series }}
is_prerelease: ${{ steps.version.outputs.is_prerelease }}
previous_tag: ${{ steps.version.outputs.previous_tag }}
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
# Previous-release detection walks tags reachable from the release commit.
fetch-depth: 0
fetch-tags: true
- name: Extract version
id: version
env:
@@ -43,27 +53,16 @@ jobs:
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
echo "tag=" >> "$GITHUB_OUTPUT"
echo "version=manual-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
echo "major_minor=" >> "$GITHUB_OUTPUT"
echo "series=" >> "$GITHUB_OUTPUT"
echo "is_prerelease=false" >> "$GITHUB_OUTPUT"
exit 0
fi
if [[ ! "$REF_NAME" =~ ^v([0-9]+\.[0-9]+\.[0-9]+)(-rc\.[0-9]+)?$ ]]; then
echo "Unsupported release tag format: $REF_NAME" >&2
exit 1
fi
version="${BASH_REMATCH[1]}${BASH_REMATCH[2]}"
major_minor="${BASH_REMATCH[1]%.*}"
is_prerelease=false
if [ -n "${BASH_REMATCH[2]}" ]; then
is_prerelease=true
fi
echo "tag=${REF_NAME}" >> "$GITHUB_OUTPUT"
echo "version=${version}" >> "$GITHUB_OUTPUT"
echo "major_minor=${major_minor}" >> "$GITHUB_OUTPUT"
echo "is_prerelease=${is_prerelease}" >> "$GITHUB_OUTPUT"
bash scripts/release_version.sh version "$REF_NAME" >> "$GITHUB_OUTPUT"
# Release notes span from the previous stable release, not the last
# release candidate. An empty value lets GitHub pick the range.
previous_tag="$(bash scripts/release_version.sh previous-tag . || true)"
echo "previous_tag=${previous_tag}" >> "$GITHUB_OUTPUT"
build-frontend:
name: Build Frontend
@@ -251,6 +250,9 @@ jobs:
tag_name: ${{ needs.prepare.outputs.tag }}
name: ${{ needs.prepare.outputs.tag }}
prerelease: ${{ needs.prepare.outputs.is_prerelease == 'true' }}
make_latest: ${{ needs.prepare.outputs.is_prerelease != 'true' }}
generate_release_notes: true
previous_tag: ${{ needs.prepare.outputs.previous_tag }}
files: artifacts/*
build-push:
@@ -334,6 +336,9 @@ jobs:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Download digests
uses: actions/download-artifact@v4
with:
@@ -360,23 +365,16 @@ jobs:
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
version="${{ needs.prepare.outputs.version }}"
if [ "${{ needs.prepare.outputs.is_prerelease }}" = "true" ]; then
docker buildx imagetools create \
-t "neosmemo/memos:${version}" \
-t "ghcr.io/usememos/memos:${version}" \
$(printf 'neosmemo/memos@sha256:%s ' *)
exit 0
fi
docker buildx imagetools create \
-t "neosmemo/memos:${version}" \
-t "neosmemo/memos:${{ needs.prepare.outputs.major_minor }}" \
-t "neosmemo/memos:stable" \
-t "ghcr.io/usememos/memos:${version}" \
-t "ghcr.io/usememos/memos:${{ needs.prepare.outputs.major_minor }}" \
-t "ghcr.io/usememos/memos:stable" \
$(printf 'neosmemo/memos@sha256:%s ' *)
tags="$(bash "$GITHUB_WORKSPACE/scripts/release_version.sh" image-tags "${{ needs.prepare.outputs.tag }}")"
args=()
while IFS= read -r tag; do
args+=(-t "neosmemo/memos:${tag}" -t "ghcr.io/usememos/memos:${tag}")
done <<< "$tags"
digests=()
for digest in *; do
digests+=("neosmemo/memos@sha256:${digest}")
done
docker buildx imagetools create "${args[@]}" "${digests[@]}"
- name: Inspect images
run: |
+7
View File
@@ -17,6 +17,7 @@ on:
# Anything that can change how an existing database is opened or upgraded.
- "store/migration/**"
- "store/migrator.go"
- "store/schema_version*.go"
- "store/db/**"
- "store/test/containers.go"
- "store/test/migrator*_test.go"
@@ -25,6 +26,9 @@ on:
- "scripts/Dockerfile"
- "scripts/entrypoint.sh"
- "scripts/release_smoke_test.sh"
- "scripts/release_version*"
- "scripts/install*"
- ".github/workflows/release.yml"
- ".github/workflows/upgrade-smoke.yml"
concurrency:
@@ -58,6 +62,9 @@ jobs:
cache: true
cache-dependency-path: go.sum
- name: Test release versioning and installer
run: go test -v ./scripts/...
# No -race here: testcontainers has known races in its reaper, which is why
# store/test/migrator_test.go documents skipping the race detector.
- name: Run migration and upgrade tests
-3
View File
@@ -1,3 +0,0 @@
{
".": "0.31.0"
}
-407
View File
@@ -1,407 +0,0 @@
# Changelog
## [0.31.0](https://github.com/usememos/memos/compare/v0.30.0...v0.31.0) (2026-09-20)
Memos 0.31 adds Spaces for collaboration, Calendar and Map views for browsing your notes, and tools to move your memos between instances. Writing, search, attachments, and navigation also receive improvements throughout the app.
This stable release includes the changes since `0.30.0`, including both `0.31.0` release candidates.
### Highlights
* **Spaces:** Organize memos in shared Spaces, invite people through their inbox, move memos between Spaces, and choose custom icons or emoji. Space-only visibility limits a memo's audience to active Space members, with the administrator access described below. ([#6228](https://github.com/usememos/memos/pull/6228), [#6266](https://github.com/usememos/memos/pull/6266), [#6285](https://github.com/usememos/memos/pull/6285), [#6287](https://github.com/usememos/memos/pull/6287))
* **Calendar and Map:** Browse memos by month, open a day to read or add notes for that date, and explore memos with location data on a dedicated map. ([#6277](https://github.com/usememos/memos/pull/6277), [#6280](https://github.com/usememos/memos/pull/6280), [map page](https://github.com/usememos/memos/commit/bc89ec00060623cff52eacbc2c3ca82038e5c924))
* **Views and search:** Save reusable filters as Views with custom icons. Filter by Space or location, find memos outside any Space, use expressions in Quick Find, and see search matches highlighted in memo content. ([#6167](https://github.com/usememos/memos/pull/6167), [#6181](https://github.com/usememos/memos/pull/6181), [#6267](https://github.com/usememos/memos/pull/6267), [#6276](https://github.com/usememos/memos/pull/6276), [#6305](https://github.com/usememos/memos/pull/6305), [#6335](https://github.com/usememos/memos/pull/6335))
* **Export and import:** Move your memos between instances from Settings → Export & Import using Memos Export Format (ZIP). Exports include archived memos, comments you wrote, and attachment files. Older export files remain importable. This is a personal export; instance settings and other users' data are not included. ([#6334](https://github.com/usememos/memos/pull/6334), [export format](https://github.com/usememos/memos/commit/eab07d8081e7a196834f896e91cfebb0c1a73fb5))
* **Attachments:** Configure multiple named storage backends, insert attachment images into memo content, upload files in smaller chunks, and see your attachment storage usage in account settings. ([#6184](https://github.com/usememos/memos/pull/6184), [#6172](https://github.com/usememos/memos/pull/6172), [chunked uploads](https://github.com/usememos/memos/commit/b3e67399b83bc32cb27dda1f0eaa448b2108e211), [#6326](https://github.com/usememos/memos/pull/6326))
* **Writing and navigation:** Create memos from the sidebar, use Markdown formatting shortcuts, resize the desktop sidebar, and keep your Space and filters when navigating to a memo and back. ([#6219](https://github.com/usememos/memos/pull/6219), [#6258](https://github.com/usememos/memos/pull/6258), [#6148](https://github.com/usememos/memos/pull/6148), [Space navigation](https://github.com/usememos/memos/commit/af008b21533bdc50fae5ad6a438347ad84bb9419))
### Fixes and polish
* **Editor:** Improved IME and Windows emoji input, restored native mobile text assistance, attached pasted files correctly, preserved timestamp edits, and expanded tag autocomplete to more editing contexts. ([IME input](https://github.com/usememos/memos/commit/14d757ce1fb31c78590f374bc042f8dbedbc20d7), [emoji input](https://github.com/usememos/memos/commit/b4fefa94d72cd381ccdd1dcb359ade0371203cce), [#6248](https://github.com/usememos/memos/pull/6248), [pasted files](https://github.com/usememos/memos/commit/8701d93fc0a55500c3c3c27a737fb9d60dd8a82f), [timestamp edits](https://github.com/usememos/memos/commit/0716eaac2c07b00cc4c36682ad7880a1ef072162), [#6327](https://github.com/usememos/memos/pull/6327))
* **Markdown:** Improved tag recognition, stopped currency amounts from being interpreted as inline math, fixed numbered task-list toggles, and enabled telephone and SMS links. ([#6132](https://github.com/usememos/memos/pull/6132), [#6216](https://github.com/usememos/memos/pull/6216), [#6346](https://github.com/usememos/memos/pull/6346), [#6341](https://github.com/usememos/memos/pull/6341))
* **Map and media:** Restored keyless OpenStreetMap tiles, fixed navigation away from the Map after a WebGL failure, improved HEIC/HEIF detection, and added 0.5× and 0.75× audio playback. ([#6242](https://github.com/usememos/memos/pull/6242), [WebGL cleanup](https://github.com/usememos/memos/commit/305310cdd18345acc25466d24e800b3f85c49593), [#6246](https://github.com/usememos/memos/pull/6246), [audio speeds](https://github.com/usememos/memos/commit/b88a71540a1a4079c8211edeac3e81b0fb4a6a13))
* **Interface and languages:** Refined memo navigation and comment menus, corrected focus-mode and right-to-left layouts, matched the installed app's status bar to dark mode, added Azerbaijani and Hebrew, and synchronized translations across supported languages. ([#6261](https://github.com/usememos/memos/pull/6261), [comment menus](https://github.com/usememos/memos/commit/7e3d3c63156c206209fdc8e75a4fb117b1aaf1fb), [#6310](https://github.com/usememos/memos/pull/6310), [#6215](https://github.com/usememos/memos/pull/6215), [#6320](https://github.com/usememos/memos/pull/6320), [#6278](https://github.com/usememos/memos/pull/6278), [#6203](https://github.com/usememos/memos/pull/6203), [translations](https://github.com/usememos/memos/commit/2204eceeef34625cfd3e74fea7ad71769c9abc43))
### Administration and integrations
* **Security and reliability:** Added rate limits and tighter request, image-processing, and import limits; strengthened remote-fetch validation; protected S3 uploads from object-key collisions; and corrected attachment cleanup. ([#6315](https://github.com/usememos/memos/pull/6315), [hardening](https://github.com/usememos/memos/commit/471745b4314820dcb4b8b451095679ee6cfc71c3), [remote-fetch protection](https://github.com/usememos/memos/commit/f4d97fafcdab534e7e01c376d2b06a3c6aa98a33))
* **Sessions and private files:** Changing your password signs out your other sessions; an administrator password reset signs out all sessions for that account. S3 attachments are served through authenticated file routes. ([session revocation](https://github.com/usememos/memos/commit/471745b4314820dcb4b8b451095679ee6cfc71c3), [#6210](https://github.com/usememos/memos/pull/6210))
* **Access mode:** Public/private instance access is now stored independently of the instance URL. ([#6225](https://github.com/usememos/memos/pull/6225))
* **Integrations:** Added Space operations to MCP and corrected tool schemas, fixed scheduled-job day matching, and added `-V` and `--version` to the CLI. ([MCP Spaces](https://github.com/usememos/memos/commit/619eb8d6b), [MCP schemas](https://github.com/usememos/memos/commit/652957c0f98b5e66fb7b369ddef9f40ee439ef69), [#6306](https://github.com/usememos/memos/pull/6306), [#6321](https://github.com/usememos/memos/pull/6321))
### Upgrade notes
* **Administrator access:** Active instance administrators can now read and manage individual memos, including private and Space-only memos, without being their author or a Space member. Collection listings still apply audience filtering; administrators do not automatically become Space members. ([permission changes](https://github.com/usememos/memos/commit/4f4652375))
* **Views and API clients:** Existing Shortcuts are migrated to Views. Integrations using the old Shortcut API must move to the `UserService` View operations under `/api/v1/users/{user}/views`. The reaction API also removes `contentId`; reactions remain scoped to their memo. ([#6167](https://github.com/usememos/memos/pull/6167), [View operations](https://github.com/usememos/memos/commit/e02899e51), [#6221](https://github.com/usememos/memos/pull/6221))
* **Account email:** Email remains optional. Addresses are trimmed, lowercased, and unique per instance. Upgrades clear invalid addresses and keep a duplicate address only on the oldest account; affected usernames are logged. ([#6314](https://github.com/usememos/memos/pull/6314))
* **RSS:** RSS feed support has been removed. Existing feed URLs no longer provide feeds. ([#6243](https://github.com/usememos/memos/pull/6243))
## [0.31.0-rc.2](https://github.com/usememos/memos/compare/v0.31.0-rc.1...v0.31.0-rc.2) (2026-09-15)
### Highlights
* **Calendar:** Browse your memos by month and open a day to read or add memos for that date. ([#6277](https://github.com/usememos/memos/pull/6277)) ([#6280](https://github.com/usememos/memos/pull/6280))
* **Map:** Explore memos with location data on a dedicated map page. ([bc89ec0](https://github.com/usememos/memos/commit/bc89ec00060623cff52eacbc2c3ca82038e5c924))
* **Spaces:** Move memos between Spaces, receive invitations in your inbox, and personalize Spaces with icons or emoji. ([#6285](https://github.com/usememos/memos/pull/6285)) ([#6266](https://github.com/usememos/memos/pull/6266)) ([#6287](https://github.com/usememos/memos/pull/6287))
* **Space navigation:** Space selection is now part of the URL. Switching Spaces preserves the current page and filters, and returning from a memo restores its original context. ([af008b2](https://github.com/usememos/memos/commit/af008b21533bdc50fae5ad6a438347ad84bb9419))
* **Views and search:** Give saved Views custom icons, filter by Space or find memos outside any Space, and use expressions in Quick Find for advanced searches. ([#6305](https://github.com/usememos/memos/pull/6305)) ([#6267](https://github.com/usememos/memos/pull/6267)) ([#6276](https://github.com/usememos/memos/pull/6276))
* **Attachments:** Upload files in smaller chunks to reduce memory use, and see your attachment storage usage in account settings. ([b3e6739](https://github.com/usememos/memos/commit/b3e67399b83bc32cb27dda1f0eaa448b2108e211)) ([#6326](https://github.com/usememos/memos/pull/6326))
* **Writing:** Use keyboard shortcuts for Markdown formatting. On desktop, the Home editor is focused automatically on initial load. ([#6258](https://github.com/usememos/memos/pull/6258)) ([#6275](https://github.com/usememos/memos/pull/6275))
* **Audio:** Added 0.5× and 0.75× playback speeds. ([b88a715](https://github.com/usememos/memos/commit/b88a71540a1a4079c8211edeac3e81b0fb4a6a13))
* **Languages:** Added Azerbaijani and made Chinese sensitive-content labels consistent. ([#6278](https://github.com/usememos/memos/pull/6278)) ([#6274](https://github.com/usememos/memos/pull/6274))
### Fixes and polish
* **Memo navigation:** Redesigned the memo detail sidebar and made active filters easier to distinguish from the current page. ([#6261](https://github.com/usememos/memos/pull/6261)) ([aba1f73](https://github.com/usememos/memos/commit/aba1f7384d44d020ce8e4d9036c7cececb3c6c13))
* **Sidebar:** Refined spacing, simplified the account footer, and prevented navigation labels from being truncated in narrow sidebars. ([191ec01](https://github.com/usememos/memos/commit/191ec01d11186db7ab4840b41d6fe008e3729909)) ([5a65350](https://github.com/usememos/memos/commit/5a65350400f0b5f6c726a1187458ca3d91f4e38e)) ([88f1505](https://github.com/usememos/memos/commit/88f150502c9a1ec6050ff4bdd8f439f646829ab3))
* **Memo controls:** Refined compact navigation and memo actions, aligned author spacing, and made metadata controls appear when hovering over their row. ([ce0dd23](https://github.com/usememos/memos/commit/ce0dd23d2f40d5613fd40f284264fc21e5e4ae82)) ([2e33e7a](https://github.com/usememos/memos/commit/2e33e7a5619f04efd9f713b0f855c6c60641ef8c)) ([#6324](https://github.com/usememos/memos/pull/6324))
* **Editor input:** Restored native mobile text assistance and made pasted files appear as attachments. Tag suggestions now work inside code, links, and escaped text, including unfinished nested tag paths. ([#6248](https://github.com/usememos/memos/pull/6248)) ([8701d93](https://github.com/usememos/memos/commit/8701d93fc0a55500c3c3c27a737fb9d60dd8a82f)) ([#6327](https://github.com/usememos/memos/pull/6327))
* **Memo timestamps:** Preserved timestamp edits when closing the date and time popover. ([0716eaa](https://github.com/usememos/memos/commit/0716eaac2c07b00cc4c36682ad7880a1ef072162))
* **Focus mode and blurred content:** Fixed editor focus mode being constrained by the memo grid, improved overlay dimming, and kept blurred memo headers and reactions interactive. ([#6310](https://github.com/usememos/memos/pull/6310)) ([#6269](https://github.com/usememos/memos/pull/6269))
* **Dark mode:** Matched the installed web app’s status bar to the dark theme. ([#6320](https://github.com/usememos/memos/pull/6320))
### Administration and integrations
* **Account email:** Email remains optional. Addresses are now validated, trimmed, lowercased, and unique per instance. During upgrades, the oldest account keeps a duplicate address; it is cleared from other accounts, with affected usernames logged. ([#6314](https://github.com/usememos/memos/pull/6314))
* **Abuse protection:** Added rate limits for sign-in, sign-up, remote fetches, uploads, and writes. Webhook validation now also blocks unspecified destination addresses. ([#6315](https://github.com/usememos/memos/pull/6315)) ([#6284](https://github.com/usememos/memos/pull/6284))
* **MCP:** Corrected JSON Schema formats in tool definitions for better client compatibility. ([652957c](https://github.com/usememos/memos/commit/652957c0f98b5e66fb7b369ddef9f40ee439ef69))
* **Scheduled jobs:** Corrected cron matching for day-of-month and day-of-week fields. ([#6306](https://github.com/usememos/memos/pull/6306))
## [0.31.0-rc.1](https://github.com/usememos/memos/compare/v0.30.0...v0.31.0-rc.1) (2026-08-30)
### Features
* **filter:** support memo location filters ([#6181](https://github.com/usememos/memos/issues/6181)) ([57bfe0a](https://github.com/usememos/memos/commit/57bfe0a70fd2375a8be140833399a663a08581d6))
* insert attachment images into memo content ([#6172](https://github.com/usememos/memos/issues/6172)) ([9a928c2](https://github.com/usememos/memos/commit/9a928c286861958f0a08f2c2d173d073972afa7f))
* **instance:** persist access mode independently of URL ([#6225](https://github.com/usememos/memos/issues/6225)) ([76a7629](https://github.com/usememos/memos/commit/76a762924306e782871204f131f4033be5e8e41a))
* **link-preview:** support standards-based metadata ([#6206](https://github.com/usememos/memos/issues/6206)) ([16cd310](https://github.com/usememos/memos/commit/16cd3107bf324dc159ec5d1894d6c11dec7edd96))
* **markdown:** unify tag syntax and recognition ([#6132](https://github.com/usememos/memos/issues/6132)) ([c68e3d5](https://github.com/usememos/memos/commit/c68e3d5bf98394d90c7137f29d0ae378de17e824))
* persist and display client media metadata ([#6180](https://github.com/usememos/memos/issues/6180)) ([da81b6b](https://github.com/usememos/memos/commit/da81b6b48f8e6cdd35d0a38745914da0ce9b3e53))
* **sidebar:** make the desktop rail resizable ([#6148](https://github.com/usememos/memos/issues/6148)) ([abe87d9](https://github.com/usememos/memos/commit/abe87d9440783cb43c433b6fa7d35f1cc2450b4b))
* **space:** add client-defined UIDs and identity cues ([9d2b77c](https://github.com/usememos/memos/commit/9d2b77ced8ef5c4797be2345a27bc0eb35b1787b))
* **spaces:** add consent-based member invitations ([#6232](https://github.com/usememos/memos/issues/6232)) ([05f882e](https://github.com/usememos/memos/commit/05f882e43aee1d3125b66f6e8eb1d7d506de0000))
* **spaces:** add multi-space memo collaboration ([#6228](https://github.com/usememos/memos/issues/6228)) ([6da8461](https://github.com/usememos/memos/commit/6da8461e1d9b591c500e8031a716d66e2322b394))
* **spaces:** add settings management ([#6234](https://github.com/usememos/memos/issues/6234)) ([854d893](https://github.com/usememos/memos/commit/854d893fc6021505ade0d3ea5fe7ccad06a2ae56))
* **spaces:** add space-aware UI and filtering ([#6230](https://github.com/usememos/memos/issues/6230)) ([66b9cb4](https://github.com/usememos/memos/commit/66b9cb49c14e34e8e3c1f996f43d0360864ab4db))
* **spaces:** unify collection scope across resource pages ([cdd13ca](https://github.com/usememos/memos/commit/cdd13ca24ebde1c1ee46565ba2899d68f0d66b21))
* **storage:** add named attachment storage drivers ([#6184](https://github.com/usememos/memos/issues/6184)) ([7d971b1](https://github.com/usememos/memos/commit/7d971b1c6187c13b8804ad74e3321b1445ed0363))
* support memo-scoped Markdown attachment images ([#6169](https://github.com/usememos/memos/issues/6169)) ([bd636a4](https://github.com/usememos/memos/commit/bd636a43652222089a0aa485a1db720042690e77))
* **user:** define username format and mention syntax ([#6134](https://github.com/usememos/memos/issues/6134)) ([8648b97](https://github.com/usememos/memos/commit/8648b97b9e0ba3fe0de16362d8f99a5ee7f167b0))
* **web:** add a global memo composer to the sidebar ([#6219](https://github.com/usememos/memos/issues/6219)) ([f36ca93](https://github.com/usememos/memos/commit/f36ca9317dad153c89643f8b8abee619df9a3aeb))
* **web:** unify navigation in a route-aware sidebar ([#6144](https://github.com/usememos/memos/issues/6144)) ([4d26679](https://github.com/usememos/memos/commit/4d2667983fd3387e6db76fb05b51dfe376899161))
### Bug Fixes
* align memo outline links with rendered headings ([#6159](https://github.com/usememos/memos/issues/6159)) ([e5ed6e7](https://github.com/usememos/memos/commit/e5ed6e7ec60e141d6e354f3ab59906c2c47dccac))
* **api:** omit unset message fields from gateway JSON ([#6156](https://github.com/usememos/memos/issues/6156)) ([bdf87e8](https://github.com/usememos/memos/commit/bdf87e8699a68f92a4f703ce365042b662f166d0))
* **attachment:** detect heic/heif mime type from filename extension ([#6246](https://github.com/usememos/memos/issues/6246)) ([d5849bd](https://github.com/usememos/memos/commit/d5849bdf52c05b522729319091666a52dc26601c))
* **attachments:** link media to source memos ([c4221c6](https://github.com/usememos/memos/commit/c4221c6dfe51902d0c5f482802e670fda1b72751))
* **editor:** match tag autocomplete on path segments ([bbb2395](https://github.com/usememos/memos/commit/bbb23958b22063b7e663b51812e7775eca3f23ae)), closes [#6190](https://github.com/usememos/memos/issues/6190)
* **editor:** preserve IME composition during content sync ([14d757c](https://github.com/usememos/memos/commit/14d757ce1fb31c78590f374bc042f8dbedbc20d7))
* **editor:** restore Windows emoji input ([b4fefa9](https://github.com/usememos/memos/commit/b4fefa94d72cd381ccdd1dcb359ade0371203cce))
* **editor:** scope view toggles to inline presentations ([#6227](https://github.com/usememos/memos/issues/6227)) ([fc6cbab](https://github.com/usememos/memos/commit/fc6cbab7d0d0bb90cdd4cd96e4b2e45109ab6b47))
* **i18n:** complete Traditional Chinese space translations ([#6241](https://github.com/usememos/memos/issues/6241)) ([9fd3885](https://github.com/usememos/memos/commit/9fd3885e43594536e2a2ec1a7818e3fe2b3b61b4))
* **i18n:** correct French memo link label ([#6182](https://github.com/usememos/memos/issues/6182)) ([bba1d6d](https://github.com/usememos/memos/commit/bba1d6d4975a44cf60abee63a85fc1b2e2a3dea5))
* **map:** restore keyless OpenStreetMap tiles ([#6242](https://github.com/usememos/memos/issues/6242)) ([171687c](https://github.com/usememos/memos/commit/171687c456b22d42fe98e4dbfda042f985b320a0))
* **markdown:** avoid parsing currency as inline math ([#6216](https://github.com/usememos/memos/issues/6216)) ([e99ae78](https://github.com/usememos/memos/commit/e99ae78012f24108ea20574be6737f846b4b5ede))
* **markdown:** support word-internal apostrophes in tags ([#6135](https://github.com/usememos/memos/issues/6135)) ([d617f65](https://github.com/usememos/memos/commit/d617f652b01086b9619500a46dc1eb9b13e84046))
* **settings:** validate memo content length limit ([45c3a79](https://github.com/usememos/memos/commit/45c3a79b1215ecd8912b699d9d635055147041c3))
* **sidebar:** stop the month calendar growing with the rail ([d722608](https://github.com/usememos/memos/commit/d7226089476e72e4329f29d3bbe3cb1243dcc19b))
* **spaces:** add context to summary query errors ([fc7970a](https://github.com/usememos/memos/commit/fc7970a2d1244c040ea1768d7991165835b5e3e2))
* **storage:** proxy S3 attachments through authenticated routes ([#6210](https://github.com/usememos/memos/issues/6210)) ([38412eb](https://github.com/usememos/memos/commit/38412eb75afc24df3c60fed91d498fc1bce6b232))
* **store:** begin sqlite memo mutations with BEGIN IMMEDIATE ([#6192](https://github.com/usememos/memos/issues/6192)) ([f954434](https://github.com/usememos/memos/commit/f9544349202d931b90e38c01982e42245ca1c605))
* **store:** harden 0.31 migration upgrades ([#6247](https://github.com/usememos/memos/issues/6247)) ([a720870](https://github.com/usememos/memos/commit/a7208701d10bfe73a216f36d314caa1bf4976b79))
* **ui:** keep select menus above parent popovers ([9328413](https://github.com/usememos/memos/commit/93284137970d2ac1bda29f9a8feb6da9c69e3db8))
* **ui:** refine space labels and sidebar menus ([22a5f33](https://github.com/usememos/memos/commit/22a5f3385b9fc5bdf282eb597aa3db79798aa5ab))
* upgrade golang.org/x/crypto to 0.52.0 (CVE-2026-39829) ([#6152](https://github.com/usememos/memos/issues/6152)) ([3b8d255](https://github.com/usememos/memos/commit/3b8d2558edccaf194c06e5f34fff2f6681fcb76b))
* **web:** correct RTL layout behavior ([#6215](https://github.com/usememos/memos/issues/6215)) ([e67ec79](https://github.com/usememos/memos/commit/e67ec7935199c12c15053119262dc9aef074d85e))
* **web:** keep share token on shared-memo attachment thumbnails ([#6155](https://github.com/usememos/memos/issues/6155)) ([3f567fd](https://github.com/usememos/memos/commit/3f567fda4592f9f552623bd0da0dec3c622c6359))
* **web:** keep task checkboxes controlled so check-all updates render ([5192732](https://github.com/usememos/memos/commit/5192732cee40020f84c1e57dbcc53ea3d9eaa42f))
* **web:** make archived independent of space scope ([040f9ae](https://github.com/usememos/memos/commit/040f9ae717675c2206856afaf52ece67911d71ea))
* **web:** preserve memo scope across global navigation ([83eab44](https://github.com/usememos/memos/commit/83eab44695ec95205990e4e0c1045dbfa6caf4f3))
* **web:** restore sidebar and outline behavior ([#6161](https://github.com/usememos/memos/issues/6161)) ([f75d49f](https://github.com/usememos/memos/commit/f75d49f9b617e1ac1370e36e71b1869d3c52e6ca))
### Performance Improvements
* **sse:** reduce redundant connections and fanout overhead ([dd18002](https://github.com/usememos/memos/commit/dd18002b12b8632d11b57fa3d33de244bba91476))
## [0.30.0](https://github.com/usememos/memos/compare/v0.29.1...v0.30.0) (2026-07-26)
### Summary
Memos 0.30 delivers a major writing and navigation refresh, centered on the new
CodeMirror editor, richer memo detail views, configurable multi-column feeds, and
faster Explore and feed rendering. It also replaces the MCP integration with a
curated OpenAPI-driven tool surface, expands deployment-time configuration, and
strengthens authentication, sharing, and private-instance access boundaries.
This stable release includes all changes shipped through `0.30.0-rc.1` and
`0.30.0-rc.2`, plus the final authentication, SSO, sharing, and MCP fixes listed
below.
### ⚠ BREAKING CHANGES
* **Access control:** Instances without `--instance-url` (or `MEMOS_INSTANCE_URL`) now run in private mode. Anonymous visitors are sent to sign-in, anonymous API access is limited to setup, authentication, and shared-memo routes, and RSS feeds are unavailable. Set the instance URL to retain the previous public behavior. ([d1cef7a](https://github.com/usememos/memos/commit/d1cef7a9ab23e8c93f76b2f32661c720c733536d)) ([415a3ec](https://github.com/usememos/memos/commit/415a3ec73d7abee4496eab39b4d135a89387cdc6))
* **Shared memo API:** `GetMemoByShare` and `GET /api/v1/shares/{share_id}` have been replaced by `GetSharedMemo` and `GET /api/v1/shares/{share_token}/memo`. API clients must update the RPC, request type, field name, and REST path. Share-token responses are limited to the shared memo and its attachments and no longer expose the surrounding parent, comments, or relation graph. ([0d2cbd4](https://github.com/usememos/memos/commit/0d2cbd4f5a410a8edc2093b8834f8f13f6ca9ad6)) ([415a3ec](https://github.com/usememos/memos/commit/415a3ec73d7abee4496eab39b4d135a89387cdc6))
* **Filters:** `now()` has been replaced by the `now` timestamp variable, and time fields now use CEL timestamps. Update saved shortcuts to use expressions such as `created_ts >= now - duration("24h")` or `timestamp(<epoch>)` instead of comparing time fields with bare epoch values. ([26f4b73](https://github.com/usememos/memos/commit/26f4b73cb9a996f9232daad2b5daa34360742697))
* **MCP:** The MCP server is now a stateless, tools-only endpoint generated from the OpenAPI schema. The previous prompts, resources, tool-filtering headers and route aliases, and unprefixed tool names have been removed. Clients must switch to `/mcp` and the new service-prefixed tool names. Tool errors now use `isError` and text content rather than a non-standard `structuredContent.error` payload. ([#6026](https://github.com/usememos/memos/issues/6026)) ([03e34bd](https://github.com/usememos/memos/commit/03e34bd0da2f225addbd00d6a7bb5a472c83aed8))
### Highlights
* **Markdown editor:** Rebuilt the editor as a single CodeMirror 6 decorated-source editor. Markdown is preserved verbatim while headings, formatting, tags, and mentions are styled in place. The editor adds tag completion, list indentation, improved keyboard shortcuts, focus mode, and a toggleable formatting toolbar for headings, lists, task lists, code blocks, bold, italic, strikethrough, and inline code. ([5a73d7](https://github.com/usememos/memos/commit/5a73d7d3e56f853a965207ac709e8f5e84918959)) ([e3c231f](https://github.com/usememos/memos/commit/e3c231fcac5691f9590a5d685bdebec23b73be35))
* **Memo detail and navigation:** Redesigned the memo detail sidebar as a property rail with quick actions, editable visibility, memo metadata, attachments, relations, and a scroll-aware outline. Feed scroll position is restored when navigating back from another page. ([d4b5a16](https://github.com/usememos/memos/commit/d4b5a1695b9acf4da3ef72f600789a4a0f90e4d5)) ([e497895](https://github.com/usememos/memos/commit/e497895bf3b72cdae92e5bab6cd5b691c8eedc15))
* **Memo feeds:** Added persisted controls for one, two, three, or automatically fitted columns, compact mode, and link previews. Compact rendering is opt-in in single-column feeds so full memo content is shown by default. Multi-column feeds stay balanced as cards resize, while newly created memos remain easy to find above pinned content. ([177d65a](https://github.com/usememos/memos/commit/177d65a90e321fa975a7cf19bd3c075143af5c10)) ([e3e4ae1](https://github.com/usememos/memos/commit/e3e4ae10512f514f71729779b5096d0d591c8cf4)) ([cafa56f](https://github.com/usememos/memos/commit/cafa56f1a8c9091062a4b220284e8ca697b050e8))
* **MCP:** Replaced the hand-written MCP implementation with a curated OpenAPI-driven tool surface that reuses the public API's authentication and authorization. The final toolset includes memo, comment, relation, reaction, shortcut, identity, and attachment operations, including attachment uploads. Canonical and nested resource names can be passed directly to follow-up tools. ([777d227](https://github.com/usememos/memos/commit/777d227eb992c4feccd5d78c781cf8e9094e38de)) ([0e1d821](https://github.com/usememos/memos/commit/0e1d821fb84310feff40b90d899403d45bced596)) ([390126f](https://github.com/usememos/memos/commit/390126f1cd5f6aca55a17faf031655da4354b60b))
* **Deployment configuration:** Identity providers and supported instance settings can be supplied as validated JSON files under `/etc/secrets`. File-backed settings act as runtime overrides and cannot be changed through the UI or API until the files are removed. ([0038295](https://github.com/usememos/memos/commit/0038295bbc772b38425b6c7f9ca814e4d1e44260))
* **Webhooks:** Added Standard Webhooks HMAC-SHA256 signing secrets, webhook editing, and a signing-status indicator. Secrets are generated server-side, shown after creation, and can be revealed later from the edit dialog; malformed secrets now fail validation. ([#6013](https://github.com/usememos/memos/issues/6013)) ([#6027](https://github.com/usememos/memos/issues/6027))
* **Filters and tag settings:** Expanded CEL shortcuts with string matching, regular expressions, collection predicates, timestamp accessors, set operations, and an untagged-memos example. Tag colors and content-blur rules are now per-user, with existing instance tag settings copied during migration. ([f0e4a56](https://github.com/usememos/memos/commit/f0e4a5624f4371e08fb0c41510891c9f8cce6ba0)) ([b787bfa](https://github.com/usememos/memos/commit/b787bfa75f74d8ee5ec271bd308c2e5a0389ed35)) ([#6017](https://github.com/usememos/memos/issues/6017))
* **Settings and access tokens:** Refreshed settings navigation and expanded the access-token page with practical guidance, a copyable API example, safety notes, and last-used timestamps. Access tokens now default to no expiration, and the About page and documentation surface the Memos Web Clipper. ([715306e](https://github.com/usememos/memos/commit/715306ea66306a91765d3f7c3ede8bc815d2def5)) ([cc20327](https://github.com/usememos/memos/commit/cc20327b8a1d595de6fe8915be303eddc8816756)) ([f946974](https://github.com/usememos/memos/commit/f94697496b60f5fe590c2ffa19e3f0c93b749af4))
* **Internationalization and interface:** Added a searchable locale picker, expanded European locale coverage, completed missing Japanese and Simplified Chinese translations, refreshed the sign-in, sign-up, and About pages, and aligned common controls across the app. ([4183985](https://github.com/usememos/memos/commit/418398587cef90151745ba0dbc51cef4762045ca)) ([a47d049](https://github.com/usememos/memos/commit/a47d04954e75c54491138601c72f1c0cbe140f3c)) ([564da94](https://github.com/usememos/memos/commit/564da949cb87491ca8e493d2f7aedcd2ef9545a1))
* **Markdown and storage:** Added GFM footnote rendering and navigation, plus an `insecure_skip_tls_verify` option for S3-compatible storage with self-signed certificates. ([1020060](https://github.com/usememos/memos/commit/10200606db24e3d70fb8efefee99c7b0a369ddea)) ([#6039](https://github.com/usememos/memos/issues/6039))
* **Faster feeds and Explore:** Reduced initial work and bandwidth by caching fingerprinted assets, deferring media and rich renderers until needed, rendering feed content near the viewport, and sharing user and memo lookups across creators, reactions, comments, mentions, and relations. ([88c6ee8](https://github.com/usememos/memos/commit/88c6ee8ebcc341aa1d2e2ae38638a518f4745de1)) ([6c1055f](https://github.com/usememos/memos/commit/6c1055f483c92c2a95193bea07110b6775359651)) ([249b331](https://github.com/usememos/memos/commit/249b331596fd1c9ceceb4e72da8e422499be683f))
* **Demo experience:** Rebuilt the demo data around representative public and protected memos that showcase nested tags, references, comments, mentions, reactions, locations, attachments, and rich Markdown. ([469c995](https://github.com/usememos/memos/commit/469c995cc04b5e7de259156d28c58b948e85d111))
### Fixes and polish
* **Authentication and SSO:** Stabilized SSO option loading, added OAuth client-auth auto-detection, distinguished fresh instances from populated instances without an admin, and made first-time SSO provisioning atomic across SQLite, MySQL, and PostgreSQL. Valid, non-reserved SSO identifiers are used as local usernames with UUID fallback, and concurrent first sign-ins no longer leave orphaned users. ([6c17e87](https://github.com/usememos/memos/commit/6c17e87cf61cd9c62ea4ef4e25d4adb5603ffc88)) ([96cb653](https://github.com/usememos/memos/commit/96cb65320b714ef8d7993ddb7c9182350ee9da4c)) ([019f4f9](https://github.com/usememos/memos/commit/019f4f9adcfcfca73fc9e2a966d0569fac888a2c))
* **API compatibility and errors:** Aligned new resource IDs and annotations with AIP conventions while preserving legacy UUID-based identifiers, corrected canonical user-stat resource names, removed internal RPC prefixes from user-facing errors, and consistently enforced private-instance access policy across Connect, REST Gateway, files, and RSS. ([84776cc](https://github.com/usememos/memos/commit/84776cc106745278371e5a8c8d43abca6d38e8b5)) ([b7d5d09](https://github.com/usememos/memos/commit/b7d5d09f8a7445076811d6f53b98d3445ce3afac)) ([0bfeb91](https://github.com/usememos/memos/commit/0bfeb91d50fdd4bafd15c13bb02b3e2810d4b2e4)) ([415a3ec](https://github.com/usememos/memos/commit/415a3ec73d7abee4496eab39b4d135a89387cdc6))
* **MCP reliability:** Fixed round-tripping canonical resource names, nested resource routing, success-schema validation for tool errors, partial-update request schemas, path-bound request bodies, destructive-operation annotations, and oversized request handling. ([03e34bd](https://github.com/usememos/memos/commit/03e34bd0da2f225addbd00d6a7bb5a472c83aed8)) ([390126f](https://github.com/usememos/memos/commit/390126f1cd5f6aca55a17faf031655da4354b60b))
* **Editor:** Improved formatting toggles and keyboard shortcuts, file paste and drop handling, focus-mode layout, caret behavior in empty space, and CodeMirror spacing. ([c349c15](https://github.com/usememos/memos/commit/c349c1549e49950e3171b7de28faba5d89249cfa)) ([#6076](https://github.com/usememos/memos/issues/6076)) ([#6093](https://github.com/usememos/memos/issues/6093))
* **Memos and comments:** Preserved expanded task-list state, added pagination so every comment page can be loaded, included the parent memo relation in comment webhook payloads, and limited share tokens to the selected memo rather than its conversation and relation graph. ([ecbe2ab](https://github.com/usememos/memos/commit/ecbe2ab7977fcd3521aeae1226e816a9dc2a6a40)) ([#6083](https://github.com/usememos/memos/issues/6083)) ([415a3ec](https://github.com/usememos/memos/commit/415a3ec73d7abee4496eab39b4d135a89387cdc6))
* **Tags:** Tags inside links are no longer parsed as memo tags, literal tags can be escaped with a backslash, and tag names support Unicode combining marks. ([a50ce09](https://github.com/usememos/memos/commit/a50ce09e8159836aed1a97fa717488283378200f)) ([#6051](https://github.com/usememos/memos/issues/6051))
* **API and security:** Cross-origin API requests now work with bearer tokens while cookie authentication remains same-origin, and `ListUsers` returns consistent paginated results. ([385fa22](https://github.com/usememos/memos/commit/385fa22056c51a42a0eb99fd08a8876009c2c52d)) ([4bc3928](https://github.com/usememos/memos/commit/4bc39280290b0f2612ff52285689854b6cf1344b))
* **Interface:** Replaced mismatched memo skeletons with a delayed spinner, improved mobile control spacing, truncated long location labels without hiding the full address, corrected radio-group indicator alignment, and positioned tooltip arrows outside their content panels. ([#6047](https://github.com/usememos/memos/issues/6047)) ([3b601b8](https://github.com/usememos/memos/commit/3b601b841670ece4a2832341a99ccc74124a745e)) ([#6097](https://github.com/usememos/memos/issues/6097)) ([2d01420](https://github.com/usememos/memos/commit/2d01420c23372d5708904ec78e03485edb44d49b)) ([#6095](https://github.com/usememos/memos/issues/6095)) ([773e56e](https://github.com/usememos/memos/commit/773e56e537657508af4e357f9c8845af4d4f15e8))
* **Container:** Prevented the entrypoint from restarting indefinitely when `MEMOS_UID=0`. ([#6061](https://github.com/usememos/memos/issues/6061))
## [0.30.0-rc.2](https://github.com/usememos/memos/compare/v0.30.0-rc.1...v0.30.0-rc.2) (2026-07-20)
### Highlights
* **Memo detail and navigation:** Redesigned the memo detail sidebar as a property rail with quick actions, editable visibility, memo metadata, attachments, relations, and a scroll-aware outline. Feed scroll position is now restored when navigating back from another page. ([d4b5a16](https://github.com/usememos/memos/commit/d4b5a1695b9acf4da3ef72f600789a4a0f90e4d5)) ([e497895](https://github.com/usememos/memos/commit/e497895bf3b72cdae92e5bab6cd5b691c8eedc15))
* **Settings and access tokens:** Refreshed settings navigation and expanded the access-token page with practical guidance, a copyable API example, safety notes, and last-used timestamps. The About page and project documentation now surface the Memos Web Clipper. ([715306e](https://github.com/usememos/memos/commit/715306ea66306a91765d3f7c3ede8bc815d2def5)) ([06ecef3](https://github.com/usememos/memos/commit/06ecef33bc7e6bafc263b2dee71ffd290ab3dc42)) ([f946974](https://github.com/usememos/memos/commit/f94697496b60f5fe590c2ffa19e3f0c93b749af4))
* **Faster feeds and Explore:** Reduced initial work and bandwidth by caching fingerprinted assets, deferring media and rich renderers until needed, rendering feed content near the viewport, and sharing user and memo lookups across creators, reactions, comments, mentions, and relations. ([88c6ee8](https://github.com/usememos/memos/commit/88c6ee8ebcc341aa1d2e2ae38638a518f4745de1)) ([6c1055f](https://github.com/usememos/memos/commit/6c1055f483c92c2a95193bea07110b6775359651)) ([249b331](https://github.com/usememos/memos/commit/249b331596fd1c9ceceb4e72da8e422499be683f))
* **Demo experience:** Rebuilt the demo data around representative public and protected memos that showcase nested tags, references, comments, mentions, reactions, locations, attachments, and rich Markdown. ([469c995](https://github.com/usememos/memos/commit/469c995cc04b5e7de259156d28c58b948e85d111))
### Fixes and polish
* **API compatibility and errors:** Aligned new resource IDs and annotations with AIP conventions while preserving legacy UUID-based identifiers, corrected canonical user-stat resource names, and removed internal RPC prefixes from user-facing error messages. ([84776cc](https://github.com/usememos/memos/commit/84776cc106745278371e5a8c8d43abca6d38e8b5)) ([b7d5d09](https://github.com/usememos/memos/commit/b7d5d09f8a7445076811d6f53b98d3445ce3afac)) ([0bfeb91](https://github.com/usememos/memos/commit/0bfeb91d50fdd4bafd15c13bb02b3e2810d4b2e4))
* **Interface:** Corrected radio-group indicator alignment and positioned tooltip arrows outside their content panels. ([#6097](https://github.com/usememos/memos/issues/6097)) ([2d01420](https://github.com/usememos/memos/commit/2d01420c23372d5708904ec78e03485edb44d49b)) ([#6095](https://github.com/usememos/memos/issues/6095)) ([773e56e](https://github.com/usememos/memos/commit/773e56e537657508af4e357f9c8845af4d4f15e8))
## [0.30.0-rc.1](https://github.com/usememos/memos/compare/v0.29.1...v0.30.0-rc.1) (2026-07-14)
### ⚠ BREAKING CHANGES
* **Access control:** Instances without `--instance-url` (or `MEMOS_INSTANCE_URL`) now run in private mode. Anonymous visitors are sent to sign-in and anonymous API access is limited to setup, authentication, and shared-memo routes. Set the instance URL to retain the previous public behavior. ([d1cef7a](https://github.com/usememos/memos/commit/d1cef7a9ab23e8c93f76b2f32661c720c733536d))
* **Filters:** `now()` has been replaced by the `now` timestamp variable, and time fields now use CEL timestamps. Update saved shortcuts to use expressions such as `created_ts >= now - duration("24h")` or `timestamp(<epoch>)` instead of comparing time fields with bare epoch values. ([26f4b73](https://github.com/usememos/memos/commit/26f4b73cb9a996f9232daad2b5daa34360742697))
* **MCP:** The MCP server is now a stateless, tools-only endpoint generated from the OpenAPI schema. The previous prompts, resources, tool-filtering headers and route aliases, and unprefixed tool names have been removed. Clients that used them must switch to `/mcp` and the new service-prefixed tool names. ([#6026](https://github.com/usememos/memos/issues/6026))
### Highlights
* **Markdown editor:** Rebuilt the editor as a single CodeMirror 6 decorated-source editor. Markdown is preserved verbatim while headings, formatting, tags, and mentions are styled in place. The editor also adds tag completion, list indentation, and a toggleable formatting toolbar with headings, lists, task lists, code blocks, bold, italic, strikethrough, and inline code. ([5a73d7d](https://github.com/usememos/memos/commit/5a73d7d3e56f853a965207ac709e8f5e84918959)) ([e3c231f](https://github.com/usememos/memos/commit/e3c231fcac5691f9590a5d685bdebec23b73be35))
* **MCP:** Replaced the hand-written MCP implementation with a curated OpenAPI-driven tool surface that reuses the public API's authentication and authorization. The final toolset includes memo, comment, relation, reaction, shortcut, identity, and attachment operations, including attachment uploads. ([777d227](https://github.com/usememos/memos/commit/777d227eb992c4feccd5d78c781cf8e9094e38de)) ([0e1d821](https://github.com/usememos/memos/commit/0e1d821fb84310feff40b90d899403d45bced596))
* **Deployment configuration:** Identity providers and supported instance settings can be supplied as validated JSON files under `/etc/secrets`. File-backed settings act as runtime overrides and cannot be changed through the UI or API until the files are removed. ([0038295](https://github.com/usememos/memos/commit/0038295bbc772b38425b6c7f9ca814e4d1e44260))
* **Memo feeds:** Added persisted controls for one, two, three, or automatically fitted columns; compact mode; and link previews. Multi-column feeds stay balanced as cards resize, while newly created memos remain easy to find above pinned content. ([177d65a](https://github.com/usememos/memos/commit/177d65a90e321fa975a7cf19bd3c075143af5c10)) ([e3e4ae1](https://github.com/usememos/memos/commit/e3e4ae10512f514f71729779b5096d0d591c8cf4))
* **Webhooks:** Added Standard Webhooks HMAC-SHA256 signing secrets, webhook editing, and a signing-status indicator. Secrets are generated server-side, shown after creation, and can be revealed later from the edit dialog; malformed secrets now fail validation. ([#6013](https://github.com/usememos/memos/issues/6013)) ([#6027](https://github.com/usememos/memos/issues/6027))
* **Filters:** Expanded CEL shortcuts with string matching, regular expressions, collection predicates, timestamp accessors, set operations, and an untagged-memos example. ([f0e4a56](https://github.com/usememos/memos/commit/f0e4a5624f4371e08fb0c41510891c9f8cce6ba0)) ([b787bfa](https://github.com/usememos/memos/commit/b787bfa75f74d8ee5ec271bd308c2e5a0389ed35))
* **Tag settings:** Tag colors and content-blur rules are now per-user. Existing instance tag settings are copied to current users during migration. ([#6017](https://github.com/usememos/memos/issues/6017))
* **Internationalization:** Added a searchable locale picker, expanded European locale coverage, and completed missing Japanese and Simplified Chinese translations. ([4183985](https://github.com/usememos/memos/commit/418398587cef90151745ba0dbc51cef4762045ca)) ([a47d049](https://github.com/usememos/memos/commit/a47d04954e75c54491138601c72f1c0cbe140f3c))
* **Interface:** Refreshed the sign-in, sign-up, and About pages and aligned common controls across the app. Compact rendering is now opt-in in single-column feeds, so full memo content is shown by default. ([564da94](https://github.com/usememos/memos/commit/564da949cb87491ca8e493d2f7aedcd2ef9545a1)) ([cafa56f](https://github.com/usememos/memos/commit/cafa56f1a8c9091062a4b220284e8ca697b050e8))
* **Markdown and storage:** Added GFM footnote rendering and navigation, plus an `insecure_skip_tls_verify` option for S3-compatible storage with self-signed certificates. ([1020060](https://github.com/usememos/memos/commit/10200606db24e3d70fb8efefee99c7b0a369ddea)) ([#6039](https://github.com/usememos/memos/issues/6039))
### Fixes and polish
* **Authentication and setup:** Stabilized SSO option loading, added OAuth client-auth auto-detection, and distinguished fresh instances from populated instances that no longer have an admin. ([6c17e87](https://github.com/usememos/memos/commit/6c17e87cf61cd9c62ea4ef4e25d4adb5603ffc88)) ([96cb653](https://github.com/usememos/memos/commit/96cb65320b714ef8d7993ddb7c9182350ee9da4c))
* **Editor:** Improved formatting toggles and keyboard shortcuts, file paste and drop handling, focus-mode layout, caret behavior in empty space, and CodeMirror spacing. ([c349c15](https://github.com/usememos/memos/commit/c349c1549e49950e3171b7de28faba5d89249cfa)) ([#6076](https://github.com/usememos/memos/issues/6076)) ([#6093](https://github.com/usememos/memos/issues/6093))
* **Memos and comments:** Preserved expanded task-list state, added pagination so every comment page can be loaded, and included the parent memo relation in comment webhook payloads. ([ecbe2ab](https://github.com/usememos/memos/commit/ecbe2ab7977fcd3521aeae1226e816a9dc2a6a40)) ([#6083](https://github.com/usememos/memos/issues/6083))
* **Tags:** Tags inside links are no longer parsed as memo tags, literal tags can be escaped with a backslash, and tag names support Unicode combining marks. ([a50ce09](https://github.com/usememos/memos/commit/a50ce09e8159836aed1a97fa717488283378200f)) ([#6051](https://github.com/usememos/memos/issues/6051))
* **API and security:** Cross-origin API requests now work with bearer tokens while cookie authentication remains same-origin, and `ListUsers` now returns consistent paginated results. ([385fa22](https://github.com/usememos/memos/commit/385fa22056c51a42a0eb99fd08a8876009c2c52d)) ([4bc3928](https://github.com/usememos/memos/commit/4bc39280290b0f2612ff52285689854b6cf1344b))
* **Interface:** Replaced mismatched memo skeletons with a delayed spinner, improved mobile control spacing, and truncated long location labels without hiding the full address. ([#6047](https://github.com/usememos/memos/issues/6047)) ([3b601b8](https://github.com/usememos/memos/commit/3b601b841670ece4a2832341a99ccc74124a745e))
* **Container:** Prevented the entrypoint from restarting indefinitely when `MEMOS_UID=0`. ([#6061](https://github.com/usememos/memos/issues/6061))
## [0.29.1](https://github.com/usememos/memos/compare/v0.29.0...v0.29.1) (2026-06-04)
### Bug Fixes
* **markdown:** keep task item content in one grid column ([7c3bff4](https://github.com/usememos/memos/commit/7c3bff4e98223fb99a5d49f093e3cd57dd140ba4))
* support &lt;meta name=description&gt; in link previews ([#6000](https://github.com/usememos/memos/issues/6000)) ([e8d32e8](https://github.com/usememos/memos/commit/e8d32e87d1d6e4927250ad5794ba5965e0260153))
* **web:** render video attachment posters on mobile ([0e2a9a9](https://github.com/usememos/memos/commit/0e2a9a9c0ce0e2da63535210c553b3ae2f79b239))
## [0.29.0](https://github.com/usememos/memos/compare/v0.28.0...v0.29.0) (2026-05-27)
### Features
* **about:** add about page with bird sprites ([411ba7b](https://github.com/usememos/memos/commit/411ba7b34c0c23ad217a7897835097887a28a036))
* **activity-calendar:** aggregate by ViewContext.timeBasis ([8daef1d](https://github.com/usememos/memos/commit/8daef1dc89544512fff78fd64d8216b2babc2e42))
* add &lt;Placeholder&gt; component with ASCII bird states ([#5949](https://github.com/usememos/memos/issues/5949)) ([8c16ffa](https://github.com/usememos/memos/commit/8c16ffa1f1410f9413cb57ebe251b4b604f9aeff))
* add configurable `--log-level` flag ([#5934](https://github.com/usememos/memos/issues/5934)) ([f1e2a06](https://github.com/usememos/memos/commit/f1e2a06b46c7f45ba6562c308d2703fdfb4067b0))
* add dedicated shortcuts page ([#5942](https://github.com/usememos/memos/issues/5942)) ([1df6479](https://github.com/usememos/memos/commit/1df6479443c334732b862d60a0f76e61f00ebb89))
* add link metadata endpoints ([9c5c604](https://github.com/usememos/memos/commit/9c5c604944428d3f682f35c9d05a87c1d4c3152f))
* **frontend:** add pixel bird tilemaps ([cf55f11](https://github.com/usememos/memos/commit/cf55f1107273c928e7c2d6bc26df5f3efea26458))
* **memo:** add task list quick actions ([#5983](https://github.com/usememos/memos/issues/5983)) ([648b3bd](https://github.com/usememos/memos/commit/648b3bd812e5bf2b1abb9f8b3529efefe4734e7c))
* **memo:** create memos on the selected calendar date ([#5925](https://github.com/usememos/memos/issues/5925)) ([ef55013](https://github.com/usememos/memos/commit/ef55013418d68e2d6a24a6d02a0365c1ffff03d7))
* **notification:** add smtp email settings ([cd4f28a](https://github.com/usememos/memos/commit/cd4f28ae1058a125e245ea0a6eae16aea71b8f9d))
* **placeholder:** add woodpecker tilemap ([638e4f3](https://github.com/usememos/memos/commit/638e4f398e90c556f70af150a79538312c8fc760))
* render link metadata cards ([0bc5669](https://github.com/usememos/memos/commit/0bc56694b0ca347ab1eb083f62997a22007b763d))
* **stats:** admin instance resource statistics ([ea0625d](https://github.com/usememos/memos/commit/ea0625da45a419e08158ab4102051f3fe5e59b87))
* **stats:** support filtered all-user stats ([88ac3ec](https://github.com/usememos/memos/commit/88ac3ec31ee3e808db82663c04a31cf730d1221e))
* **transcription:** explicit STT settings with provider, model, prompt ([#5926](https://github.com/usememos/memos/issues/5926)) ([238f27d](https://github.com/usememos/memos/commit/238f27dea149492a78a8994470b0aac55fece78d))
### Bug Fixes
* avoid update event on memo create attachments ([#5961](https://github.com/usememos/memos/issues/5961)) ([3c3382a](https://github.com/usememos/memos/commit/3c3382a3c652bed3b58058931ff3cbf1d875b9a8))
* delete user cleanup ([#5981](https://github.com/usememos/memos/issues/5981)) ([e53b7d9](https://github.com/usememos/memos/commit/e53b7d96e70965529ba3b04ea720ea6966f77b60))
* **editor:** wrap selected text when pasting URL ([e0bb3a2](https://github.com/usememos/memos/commit/e0bb3a2e684e932309df2f9fb0ff774ce8e6b692))
* **fileserver:** preserve HDR image metadata in thumbnails ([c724232](https://github.com/usememos/memos/commit/c7242324a18962e453e7f2a0309a7c07b358bdbe))
* **frontend:** correct static cache headers ([084f40b](https://github.com/usememos/memos/commit/084f40bc9e5922ff2d41c08dce837b96696437aa))
* **frontend:** use correct url path for memos in sitemap.xml ([#5921](https://github.com/usememos/memos/issues/5921)) ([603781f](https://github.com/usememos/memos/commit/603781f792b2603fbda93146988a64a93c92d760))
* **httpgetter:** prevent DNS rebinding in link metadata fetch ([078488c](https://github.com/usememos/memos/commit/078488ca818626fbcab69bdfb4b93b58dca6b6eb))
* **markdown:** align list items with checkboxes ([e008b1a](https://github.com/usememos/memos/commit/e008b1a23c77945eff87707eb15578d4d6d74e4c))
* **memo:** enforce parent visibility for comments ([4a1e401](https://github.com/usememos/memos/commit/4a1e401bd99c7850ac48e9693b25c9ebeecfb042))
* **s3presign:** preserve motion media payload ([7f1f53f](https://github.com/usememos/memos/commit/7f1f53ffc417962f6930d1e6e3783eacd911003d))
* **security:** enforce attachment ownership on memo updates ([35bf761](https://github.com/usememos/memos/commit/35bf761b8c2c3f155bdc06e9b373b6076116a725))
* **sse:** stream initial response and refresh tokens ([21303e8](https://github.com/usememos/memos/commit/21303e879d2c7a857306206d2cbdae83f61983e6))
* **user:** omit internal settings from list responses ([#5917](https://github.com/usememos/memos/issues/5917)) ([1df3fe7](https://github.com/usememos/memos/commit/1df3fe79559ccf94b6c71e9ffb58e870ed43820d))
* **web:** sync avatar changes immediately after profile update ([#5903](https://github.com/usememos/memos/issues/5903)) ([328396a](https://github.com/usememos/memos/commit/328396a97f2219592032e8418c383e0ab7edaca6))
### Performance Improvements
* lazy load heavy first-screen dependencies ([#5947](https://github.com/usememos/memos/issues/5947)) ([a6024ee](https://github.com/usememos/memos/commit/a6024eebf129c4b8fb65ee0cba09c6657274bfde))
## [0.28.0](https://github.com/usememos/memos/compare/v0.27.1...v0.28.0) (2026-04-27)
### Features
* **auth:** add SSO user identity linkage ([#5883](https://github.com/usememos/memos/issues/5883)) ([d688914](https://github.com/usememos/memos/commit/d688914b2864791eeadbf21c882608632875f17c))
* **memos:** choose created or updated time for memos ([#5894](https://github.com/usememos/memos/issues/5894)) ([c268551](https://github.com/usememos/memos/commit/c268551a16929a2cbea6891951feff91926bba59))
* redesign account and SSO management ([#5886](https://github.com/usememos/memos/issues/5886)) ([ee17998](https://github.com/usememos/memos/commit/ee1799851e88674a6920c7a56d93428fcf95e662))
### Bug Fixes
* **auth:** harden authorization and username validation ([#5890](https://github.com/usememos/memos/issues/5890)) ([0fb83a7](https://github.com/usememos/memos/commit/0fb83a745dd5057ade45a3caad2c444af2239113))
* disable modal prop on DropdownMenu to prevent scroll disappearing ([#5861](https://github.com/usememos/memos/issues/5861)) ([d98f665](https://github.com/usememos/memos/commit/d98f6659190b8d1a8252e64549d9120d85e05d33))
* fix legacy username auth flows ([#5885](https://github.com/usememos/memos/issues/5885)) ([30c0611](https://github.com/usememos/memos/commit/30c0611a82f9254952a74650095105254f2940e4))
* **markdown:** split mixed task and bullet lists ([e2c6084](https://github.com/usememos/memos/commit/e2c60845eaff9a78b8d8eb3ccc9a067ef5690976))
* reduce list memo query overhead ([#5880](https://github.com/usememos/memos/issues/5880)) ([5063804](https://github.com/usememos/memos/commit/50638040f618b02b0c6d010e1d41554c75067517))
* **web:** preserve task checkbox state ([#5867](https://github.com/usememos/memos/issues/5867)) ([b5863d7](https://github.com/usememos/memos/commit/b5863d76be3cfbf3e0f8237d8e762122b5a0a679))
## [0.27.1](https://github.com/usememos/memos/compare/v0.27.0...v0.27.1) (2026-04-19)
### Bug Fixes
* mixed-case user resource names ([#5853](https://github.com/usememos/memos/issues/5853)) ([01be01f](https://github.com/usememos/memos/commit/01be01f4b7676af41bdd1758b1e9b096aa922546))
* **release:** inject build version into artifacts ([f8a304b](https://github.com/usememos/memos/commit/f8a304bae33086320b39095d631288156eec4249))
* user resource names can be uuidv4 from idp sub claim ([#5856](https://github.com/usememos/memos/issues/5856)) ([bbded58](https://github.com/usememos/memos/commit/bbded584ce85a856d863485768e08b53adec7244))
## [0.27.0](https://github.com/usememos/memos/compare/v0.26.2...v0.27.0) (2026-04-18)
### Features
* add --allow-private-webhooks flag to bypass SSRF protection ([#5694](https://github.com/usememos/memos/issues/5694)) ([cd5816c](https://github.com/usememos/memos/commit/cd5816c428931f56561f7d48b649a33858812539))
* add blur_content attribute to tag metadata settings ([#5767](https://github.com/usememos/memos/issues/5767)) ([45b2153](https://github.com/usememos/memos/commit/45b21530d9ebbc730e77bcbcf407f4c295b52e93))
* add Gemini transcription provider ([#5830](https://github.com/usememos/memos/issues/5830)) ([d87539a](https://github.com/usememos/memos/commit/d87539a1e1261590ab355220e33fa0ae00bd9431))
* add GitHub release installer and release workflow ([1ed542c](https://github.com/usememos/memos/commit/1ed542c21db421e9aa0cc47417a92c6bd103e257))
* add live refresh via Server-Sent Events (SSE) with visual indicator ([#5638](https://github.com/usememos/memos/issues/5638)) ([ea0892a](https://github.com/usememos/memos/commit/ea0892a8b26d8806a093e3a942562dfc22794f68))
* add MCP server with PAT authentication ([47d9414](https://github.com/usememos/memos/commit/47d9414702dc18966af385352b960bfe451511b7))
* add outline navigation to memo detail sidebar ([#5771](https://github.com/usememos/memos/issues/5771)) ([6b30579](https://github.com/usememos/memos/commit/6b3057990396f9cb6f21706c2e99dddebc35ffd5))
* **ai:** add BYOK audio transcription ([#5832](https://github.com/usememos/memos/issues/5832)) ([101704c](https://github.com/usememos/memos/commit/101704c8eac17c7f34508d8db6c53bc972061cdb))
* **ai:** add instance AI providers and transcription ([#5829](https://github.com/usememos/memos/issues/5829)) ([83ed32f](https://github.com/usememos/memos/commit/83ed32f1195841d2d6c057c3e00086a3147879a2))
* **attachments:** add Live Photo and Motion Photo support ([#5810](https://github.com/usememos/memos/issues/5810)) ([4b4e719](https://github.com/usememos/memos/commit/4b4e719470184e49cd62084b1aa53c9a777a9fec))
* **cli:** add version subcommand ([#5731](https://github.com/usememos/memos/issues/5731)) ([0ba4c0f](https://github.com/usememos/memos/commit/0ba4c0f397c532a5a314f35ddeb3ce3633e84d42))
* **editor:** add voice note recording to the memo composer ([#5801](https://github.com/usememos/memos/issues/5801)) ([c0d5854](https://github.com/usememos/memos/commit/c0d5854f678f357cf4054d448e0311f2ee90f8ac))
* extract title from first H1 heading into memo property ([#5726](https://github.com/usememos/memos/issues/5726)) ([1e688b2](https://github.com/usememos/memos/commit/1e688b2a5d78c2972f4b0078a7b033dae5d1cbf3))
* **i18n:** update sse connect label in Chinese ([#5732](https://github.com/usememos/memos/issues/5732)) ([89c6902](https://github.com/usememos/memos/commit/89c69028953fa33dbb6e0e257d764636c0fc2d09))
* **instance:** add canonical tag metadata setting ([#5736](https://github.com/usememos/memos/issues/5736)) ([65d14fb](https://github.com/usememos/memos/commit/65d14fbb63053fc1fbf1f63881c81adbc9d01671))
* **instance:** add notification transport setting ([#5737](https://github.com/usememos/memos/issues/5737)) ([a249d06](https://github.com/usememos/memos/commit/a249d06e2e0f33e0e3fea34471a891352dacc466))
* **mcp:** enhance MCP server with full capabilities and new tools ([#5720](https://github.com/usememos/memos/issues/5720)) ([b8e9ee2](https://github.com/usememos/memos/commit/b8e9ee2b26a59e1b19aab6db3ca39656fc18785a))
* **mcp:** harden tool exposure and side effects ([#5850](https://github.com/usememos/memos/issues/5850)) ([583c3d2](https://github.com/usememos/memos/commit/583c3d24f4d785faa5e034c1b88ed90eda119baa))
* **mcp:** refactor MCP server to standard protocol structure ([803d488](https://github.com/usememos/memos/commit/803d488a5f8f55477cd3ad4cc4cf0fac98901dd3))
* **memo-editor:** add compact live waveform recorder panel ([#5817](https://github.com/usememos/memos/issues/5817)) ([e51985a](https://github.com/usememos/memos/commit/e51985a29ffeeecd318b2fb793358ed45bb0eff4))
* **memo-preview:** support comment metadata in previews ([#5768](https://github.com/usememos/memos/issues/5768)) ([e176b28](https://github.com/usememos/memos/commit/e176b28c801cc3bb3718208a96a7d64c36620d0f))
* **memo:** add image sharing in detail view ([38fc22b](https://github.com/usememos/memos/commit/38fc22b7541b8a9ddcd848cf77054fcf844eb87f))
* **memo:** add share links for private memos ([#5742](https://github.com/usememos/memos/issues/5742)) ([3f3133d](https://github.com/usememos/memos/commit/3f3133d6e2f404061e147f9dd2424680dc0303a3))
* **mentions:** add memo mention parsing, notifications, and rendering ([#5811](https://github.com/usememos/memos/issues/5811)) ([24fc8ab](https://github.com/usememos/memos/commit/24fc8ab8ca68d092e7b12a5d51c48ca9420f72b5))
* replace auto-increment ID with UID for identity provider resource names ([#5687](https://github.com/usememos/memos/issues/5687)) ([92d937b](https://github.com/usememos/memos/commit/92d937b1aa87365152edc005a3b736e6bf9b9e45))
* show inline comment preview in list view ([3a5d3c8](https://github.com/usememos/memos/commit/3a5d3c8ff92ae5c24559dc4574300d6475820a87))
* **store:** change default storage type to local filesystem ([78efa68](https://github.com/usememos/memos/commit/78efa6802e2fd96c981e86c5b658fb4b5c05091f))
* treat tag setting keys as anchored regex patterns ([#5759](https://github.com/usememos/memos/issues/5759)) ([9e04049](https://github.com/usememos/memos/commit/9e04049632e63f1cf53535773f170c1aa5af7168))
* **ui:** allow navigating between images with arrows in preview dialog ([#5669](https://github.com/usememos/memos/issues/5669)) ([104d2ec](https://github.com/usememos/memos/commit/104d2ec0a6973e983c46724165fdc0916515ad16))
* **user:** add per-user tag metadata settings ([#5735](https://github.com/usememos/memos/issues/5735)) ([330291d](https://github.com/usememos/memos/commit/330291d4d9fa95649e940001898929b4f6f0367e))
* **web:** add demo mode banner ([#5836](https://github.com/usememos/memos/issues/5836)) ([35504cc](https://github.com/usememos/memos/commit/35504cc8bd6f9921291fb565633d549388a3f948))
* **webhook:** dispatch webhook on memo comment creation ([7c1defb](https://github.com/usememos/memos/commit/7c1defba01fbc91cc81e1a0841cecb6738056db7))
### Bug Fixes
* access token refresh on web app ([#5681](https://github.com/usememos/memos/issues/5681)) ([3010f10](https://github.com/usememos/memos/commit/3010f10eafb49af5aadd71a94b3ef7a6ec71f617))
* add unix socket file permission setting (755 -&gt; 660) ([#5849](https://github.com/usememos/memos/issues/5849)) ([0fc1dab](https://github.com/usememos/memos/commit/0fc1dab28b33f7fdbe9a21cd3bd3affe75dd7f19))
* **api:** appease image size lint ([ff6389a](https://github.com/usememos/memos/commit/ff6389a5ef73772fcb5c132bf1cb169fb4744c00))
* **api:** improve SSE hub design and fix double-broadcast on comments ([c53677f](https://github.com/usememos/memos/commit/c53677fcba202a8eed35c8ecdfaacea5152b8691))
* **api:** make credentials write-only and restrict sensitive settings to admins ([9d3a74b](https://github.com/usememos/memos/commit/9d3a74bcccf934aa2fa95ee240b56cc3b3a25776))
* **api:** reduce memory pressure in backend paths ([c456637](https://github.com/usememos/memos/commit/c45663761d148e94d3e1b30f4810922e7c2571ab))
* **api:** remove public activity service ([#5734](https://github.com/usememos/memos/issues/5734)) ([04f239a](https://github.com/usememos/memos/commit/04f239a2fc74f7090c779a6a7b8a08238fd31b88))
* **api:** restrict user email exposure to self and admins ([#5784](https://github.com/usememos/memos/issues/5784)) ([a24d420](https://github.com/usememos/memos/commit/a24d4209222814e4a8bedfc0392e91462bc855ad))
* **api:** switch user resource names to usernames ([#5779](https://github.com/usememos/memos/issues/5779)) ([acddef1](https://github.com/usememos/memos/commit/acddef1f3dcca44806bcbb85e9dc5cae7daa5285))
* **api:** tolerate missing related users in memo conversions ([#5809](https://github.com/usememos/memos/issues/5809)) ([25feef3](https://github.com/usememos/memos/commit/25feef3aadd34bfd474d7e3b685815a6509bc4c6))
* **auth:** recover session via refresh cookie when localStorage is empty ([#5748](https://github.com/usememos/memos/issues/5748)) ([551ee1d](https://github.com/usememos/memos/commit/551ee1d81f398abdcaf73a0c2b782c8379b0e3f2))
* backend tests action ([065e817](https://github.com/usememos/memos/commit/065e817470b1d3b6b00222525791b85d825c1492))
* clear content search filter when selecting shortcut ([#5499](https://github.com/usememos/memos/issues/5499)) ([2c3f9e3](https://github.com/usememos/memos/commit/2c3f9e3bfbe09e5d0028d1525c1df83c03f547c9))
* correct typos in comments, error messages, and identifiers ([#5704](https://github.com/usememos/memos/issues/5704)) ([8f43e80](https://github.com/usememos/memos/commit/8f43e8075b62706f99da4005ab04b165b35215f6))
* detect legacy installations with empty schema version ([9628d3d](https://github.com/usememos/memos/commit/9628d3de21289e887ffeb6cc4b6710913a0de44e))
* **editor:** show newly linked memos when editing a memo with attachments ([026ea92](https://github.com/usememos/memos/commit/026ea92f7b4005c30ca84340c22018740659ab51))
* ensure comment divs span full width in MemoDetail ([ce44164](https://github.com/usememos/memos/commit/ce441644af34ffff156f1793c40011c2b82e8d5f))
* **fileserver:** render SVG attachment previews ([40fd700](https://github.com/usememos/memos/commit/40fd700fb8be27a8d7a300a2636cf4f366572176))
* **filter:** enforce CEL syntax semantics ([0e89407](https://github.com/usememos/memos/commit/0e89407ee91deda87e0df7464a89d26d1e9a88b3))
* **frontend:** restore sitemap and robots routes ([fee7fcd](https://github.com/usememos/memos/commit/fee7fcd6608b9d07da1f146c33c9bb8f898f708f))
* handle chunk load errors after redeployment with auto-reload ([#5703](https://github.com/usememos/memos/issues/5703)) ([bdd3554](https://github.com/usememos/memos/commit/bdd3554b897246bac5c1e6fd801495c24b6a656e))
* harden memo content iframe and HTML sanitization ([7e21b72](https://github.com/usememos/memos/commit/7e21b728b346e80023c93e8986130f83e70584f9))
* hide transcribe button without AI provider ([ab53329](https://github.com/usememos/memos/commit/ab5332901fd6626f0a2ae6b99671af9663f68078))
* improve image preview dialog and live photo trigger ([aafcc21](https://github.com/usememos/memos/commit/aafcc21ae6f96a313fb372365dd1af8a1a69d1ba))
* improve installer compatibility and docs ([f90d9a4](https://github.com/usememos/memos/commit/f90d9a49a78d0764a6c5cf8f6720e69ea1164b25))
* improve KaTeX and Mermaid error handling and overflow ([6b37fcc](https://github.com/usememos/memos/commit/6b37fcc01b5dcded6a2ec254fbaf895f7812d072))
* include plain URLs and tags in memo snippet generation ([#5688](https://github.com/usememos/memos/issues/5688)) ([3d4f793](https://github.com/usememos/memos/commit/3d4f793f97b567bda823a60b7fe10e09e14499ce))
* **lint:** correct goimports struct literal alignment after removing write-only credential fields ([#5794](https://github.com/usememos/memos/issues/5794)) ([9610ed8](https://github.com/usememos/memos/commit/9610ed8fc809b3e7aa4b93e4909634957fa94cf7))
* **map:** align dark mode map styling ([7ac9989](https://github.com/usememos/memos/commit/7ac9989d43f3967b466f340da3841290d86b20f1))
* **map:** refine Leaflet controls and memo map styling ([894b3eb](https://github.com/usememos/memos/commit/894b3eb045c7d2c2acce847c34a85295c909dcf7))
* **markdown:** support height/width attributes on img elements ([737acbb](https://github.com/usememos/memos/commit/737acbba2f5e3dd911da3a77d2d5d1cde1bf8ba1))
* **memo-editor:** scope Cmd+Enter save to the active editor ([#5745](https://github.com/usememos/memos/issues/5745)) ([05810e7](https://github.com/usememos/memos/commit/05810e7882cb03d448d9d8fa84bc6ca54eafbed0))
* **mysql:** handle CreateMemo custom timestamps with FROM_UNIXTIME ([#5673](https://github.com/usememos/memos/issues/5673)) ([09d73e8](https://github.com/usememos/memos/commit/09d73e8b6e16c43a61767817909a472916c83daa))
* normalize attachment MIME types before validation ([c3e7e2c](https://github.com/usememos/memos/commit/c3e7e2c316d01bf857931c38303efc87307f2a19))
* preserve draft content when tab is suspended or editor remounts ([9ca7122](https://github.com/usememos/memos/commit/9ca71229a6c0dfad44b76ed06fced46c5bef49c7))
* prevent local attachment uploads from overwriting files ([4add9b0](https://github.com/usememos/memos/commit/4add9b04ad5d0b7608c985281f5975dc39f9a572))
* prevent stale comment drafts from being restored ([e520b63](https://github.com/usememos/memos/commit/e520b637fd8d0f6331674003abe72f9dfbae8231))
* remove duplicate Japanese locale keys ([efeb28c](https://github.com/usememos/memos/commit/efeb28c872a2bd6edd28fa3b68bd0b15af923d50))
* render audio attachments as inline players ([#5699](https://github.com/usememos/memos/issues/5699)) ([2ccb98a](https://github.com/usememos/memos/commit/2ccb98a6cbc40544e81eeeca2a2cbbaf8348f45e))
* restrict archived memo access to creator only ([#5707](https://github.com/usememos/memos/issues/5707)) ([f4154d0](https://github.com/usememos/memos/commit/f4154d090be3896c8e0dd83440f24953bbeb308c))
* **routing:** redirect unauthenticated users to /explore when public visibility is allowed ([98859eb](https://github.com/usememos/memos/commit/98859eb5e5065a7c12ada983b7c38c5af5035bb6))
* **server:** close SSE clients during shutdown ([a5ddd5a](https://github.com/usememos/memos/commit/a5ddd5adafef282f00b23e00e145119d4316f24f))
* sync html lang attribute with active locale ([#5753](https://github.com/usememos/memos/issues/5753)) ([be00abe](https://github.com/usememos/memos/commit/be00abe852479820b7c574e15e276d70961ab7bd))
* tag parsing truncates emojis with variation selectors ([#5496](https://github.com/usememos/memos/issues/5496)) ([3ea6ea3](https://github.com/usememos/memos/commit/3ea6ea3108f58dc34f39fa6f21d761bd2e97732b))
* **tags:** allow blur-only tag metadata ([#5800](https://github.com/usememos/memos/issues/5800)) ([1921b57](https://github.com/usememos/memos/commit/1921b57662c2129d179930f71e5c42caf9070a19))
* toggle focus mode do not reset editor height ([#5504](https://github.com/usememos/memos/issues/5504)) ([0729779](https://github.com/usememos/memos/commit/0729779e0427c68bdbc5b6b711a5683f66ba9bbc))
* **ui:** show comment editor above the comment list ([#5662](https://github.com/usememos/memos/issues/5662)) ([6b0736b](https://github.com/usememos/memos/commit/6b0736b29325ff7698b7395dc761f2ca41e6521c))
* **ui:** unify metadata component styles across MemoView and MemoEditor ([664b8c5](https://github.com/usememos/memos/commit/664b8c56290026ba2beb7b75db24c684824b8670))
* unify live photo previews around LIVE badge playback ([6b0487d](https://github.com/usememos/memos/commit/6b0487dcd857ba72189ca0624cb4985961f08f25))
* **webhooks:** trigger memo updates for attachment and relation changes ([#5795](https://github.com/usememos/memos/issues/5795)) ([acbc914](https://github.com/usememos/memos/commit/acbc914dea8d4e533028b03929193a4af1ac32b4))
* **web:** prevent MemoContent prop leaks ([22519b5](https://github.com/usememos/memos/commit/22519b57a0a971ab927a03015c994c63b8c3f1da))
* **web:** refine attachment media layout ([a0d83e1](https://github.com/usememos/memos/commit/a0d83e1a9e9d0ba50a0103e594adb011728faf8c))
* **web:** refresh memo detail cache after editor save ([333c9df](https://github.com/usememos/memos/commit/333c9df233240a843a9e62d17c6ff464690636f8))
* **web:** use BroadcastChannel to sync token refreshes across tabs ([bbdc998](https://github.com/usememos/memos/commit/bbdc998646e8093223a448378a2c29690f0d8612))
### Performance Improvements
* batch load memo relations when listing memos ([#5692](https://github.com/usememos/memos/issues/5692)) ([1e82714](https://github.com/usememos/memos/commit/1e82714a52c72455a6ba02605cc641d7ad4fbf1a))
+6
View File
@@ -40,6 +40,12 @@ docker run -d \
Other install options are in the [deployment guide](https://usememos.com/docs/deploy).
Releases use `YY.MM`, with optional point releases such as `26.09.1` and release
candidates such as `26.09-rc.1`. Calendar release tags have no `v` prefix. The Docker `stable` tag follows stable releases;
`canary` follows development builds. If upgrading from a release before v0.31.0,
run [v0.31.0](https://github.com/usememos/memos/releases/tag/v0.31.0) successfully.
See the [upgrade requirements](store/migration/README.md) for earlier versions.
## Web Clipper
Save pages, selections, and images from your browser straight into Memos as source-linked Markdown. Get the [Memos Web Clipper](https://usememos.com/web-clipper) for [Chrome](https://chromewebstore.google.com/detail/memos-web-clipper/nebaoebnljalfegiidibihhkebeiklbl) or [Firefox](https://addons.mozilla.org/en-US/firefox/addon/memos-web-clipper/).
+5 -1
View File
@@ -140,6 +140,10 @@ General account erasure remains deferred. As a fail-closed guard, user hard dele
### Persistence and migration
Historical upgrade scripts are now provided by the v0.31.0 release, with the
current binary retaining the fresh-install schemas. See the
[database migration baseline](../../store/migration/README.md).
```text
space(id, uid, title, description)
space_member(space_id, user_id, status INVITED | ACTIVE, role ADMIN | USER)
@@ -151,7 +155,7 @@ The Space-user pair is unique and represents one current relationship slot. `INV
`status` is required and has no default or database `CHECK`; Store logic writes and recognizes `INVITED` and `ACTIVE`, while unknown values fail closed in authorization queries. The existing role constraint remains unchanged. The initial version does not record inviter, invitation, Space, or membership timestamps; they can be added when a concrete attribution, expiration, audit, or ordering requirement exists. A nullable `memo.space_id` directly enforces zero-or-one placement; an association table is unnecessary. Existing `memo_relation` rows remain the source of truth for comments.
The change ships in migration `0.31` for SQLite, MySQL, and PostgreSQL, with equivalent fresh-install schemas. Existing membership rows are backfilled to `ACTIVE`. Existing memos keep their UID, author, visibility, relations, permalink, and become Unassigned. Comment rows and comment visibility are not rewritten. SQLite rebuilds the affected tables where its `ALTER TABLE` support requires it.
The change shipped in v0.31.0, migration `0.31` for SQLite, MySQL, and PostgreSQL, with equivalent fresh-install schemas. Existing membership rows are backfilled to `ACTIVE`. Existing memos keep their UID, author, visibility, relations, permalink, and become Unassigned. Comment rows and comment visibility are not rewritten. SQLite rebuilds the affected tables where its `ALTER TABLE` support requires it.
Space creation, invitation transitions, membership changes, placement and audience changes, comment creation, memo deletion, and Space deletion use ordinary transactions where partial application would corrupt directly affected data. On MySQL and PostgreSQL, operations that create or activate a Space relationship serialize with user deletion on the target user row, and invitation creation serializes with Space deletion on the Space row. On SQLite every store transaction begins `IMMEDIATE`, so a transaction that has read a parent row holds the single write lock until it ends and a concurrent delete waits rather than committing underneath it. This prevents a concurrent delete from leaving an orphaned active membership or invitation. Space deletion directly removes assigned memos and their owned rows in the same style as existing user deletion, then uses the existing best-effort attachment storage cleanup after commit. The initial version does not introduce general transaction retries, a cleanup queue, or a global concurrency framework.
+9 -3
View File
@@ -75,7 +75,13 @@ Nullable is chosen over a partial unique index because MySQL has no partial inde
The Go type `store.User.Email` stays `string`. The driver boundary maps `""` to `NULL` on write and `NULL` to `""` on read. Callers never see `NULL`. `FindUser.Email` trims and lowercases its argument before querying, so a lookup with different casing still hits the index; an empty lookup returns nothing rather than every user without an address.
### Migration
### Migration (historical v0.31.0)
The following describes the upgrade performed by v0.31.0. Its SQL scripts,
Go preparation step, and legacy replay tests have since been removed from the
current binary. Older installations must run v0.31.0 first; see the
[database migration baseline](../../store/migration/README.md).
The change ships as `0.31/07__unique_email.sql` for each driver, plus matching `LATEST.sql` updates. The unique index is always the last statement, so a failure part-way through never leaves a constraint over unrepaired data.
@@ -92,7 +98,7 @@ DDL and ordering per driver:
- MySQL switches the column to `utf8mb4_bin` and nullable first, then repairs. Grouping under the server's default collation could treat accent variants as one address and clear one of them needlessly; under the binary collation the repair compares bytes, which is what the application does.
- PostgreSQL alters the column, then repairs, all inside the migration transaction.
Then the unique index is created, guarded with `IF NOT EXISTS` on SQLite and PostgreSQL and with a prepared-statement check on MySQL, so the file is a no-op on a database that already carries it. The store test suite rewinds the schema version on fresh installs to exercise individual migrations, and every later migration has to tolerate that.
Then the unique index is created, guarded with `IF NOT EXISTS` on SQLite and PostgreSQL and with a prepared-statement check on MySQL, so the file is a no-op on a database that already carries it. The v0.31.0 store tests rewound the schema version on fresh installs to exercise these migrations. Current upgrade tests instead run released binaries through the fixed v0.31.0 baseline.
SQL `LOWER` is not a reliable canonicalizer: SQLite folds ASCII only and PostgreSQL does the same under a C locale, so `Ä@example.com` and `ä@example.com` could both survive deduplication and the index would then permit a canonical collision. The migrator therefore gains one targeted pre-flight, not a general hook system. When the stored schema version is below this migration's version, a Go function reads every non-empty address ordered by id and first rewrites any row whose stored value differs from its Unicode-lowercased, trimmed form, so the SQL that follows sees exactly the canonical values `NormalizeEmail` would produce. It then applies the migration's rules in memory and logs one warning per duplicate group naming the username that keeps the address and the usernames that will be cleared, plus one line listing the users whose value will be cleared as malformed. Addresses themselves are not logged; usernames are enough for the operator to find the accounts. A failure in either step is logged and never blocks the migration. The log is the record. Nothing else stores the cleared values. Cleared accounts can set an address again from the profile page.
@@ -127,7 +133,7 @@ The web app changes in one place: the account settings form shows the `AlreadyEx
### Testing
- Store tests on all three drivers through the existing testcontainers harness: canonical-form round trip, `NULL` mapping, duplicate insert returns `ErrEmailTaken`, concurrent inserts of the same address yield exactly one success, `FindUser.Email` with mixed case hits.
- A migration test on all three drivers that seeds the pre-0.31 legacy schema fixture with mixed-case and non-ASCII duplicates, surrounding whitespace, `''`, a display-name form, interior whitespace, and a value without `@`, migrates, and asserts the survivor rule, the `NULL` conversion, case-folded lookup, the index, id continuity across the SQLite rebuild, and that re-running the migrator is a no-op.
- Historical v0.31.0 migration coverage on all three drivers seeds the pre-0.31 legacy schema fixture with mixed-case and non-ASCII duplicates, surrounding whitespace, `''`, a display-name form, interior whitespace, and a value without `@`, migrates, and asserts the survivor rule, the `NULL` conversion, case-folded lookup, the index, id continuity across the SQLite rebuild, and that re-running the migrator is a no-op.
- API tests: signup, admin create, update, and `validate_only` reject malformed addresses with `InvalidArgument` and duplicates with `AlreadyExists`; SSO first login with a colliding address creates the account with no address and does not link.
- Unit tests for the canonical-form function covering display-name forms, whitespace, length, and case.
-45
View File
@@ -1,12 +1,5 @@
package version
import (
"fmt"
"strings"
"golang.org/x/mod/semver"
)
// Version is set by release builds and defaults to a development build marker.
var Version = "dev"
@@ -16,41 +9,3 @@ var Commit = "unknown"
func GetCurrentVersion() string {
return Version
}
// GetMinorVersion extracts the minor version (e.g., "0.25") from a full version string (e.g., "0.25.1").
// Returns the minor version string or empty string if the version format is invalid.
// Version format should be "major.minor.patch" (e.g., "0.25.1").
func GetMinorVersion(version string) string {
versionList := strings.Split(version, ".")
if len(versionList) < 2 {
return ""
}
// Return major.minor only (first two components)
return versionList[0] + "." + versionList[1]
}
// IsVersionGreaterOrEqualThan returns true if version is greater than or equal to target.
func IsVersionGreaterOrEqualThan(version, target string) bool {
return semver.Compare(fmt.Sprintf("v%s", version), fmt.Sprintf("v%s", target)) > -1
}
// IsVersionGreaterThan returns true if version is greater than target.
func IsVersionGreaterThan(version, target string) bool {
return semver.Compare(fmt.Sprintf("v%s", version), fmt.Sprintf("v%s", target)) > 0
}
type SortVersion []string
func (s SortVersion) Len() int {
return len(s)
}
func (s SortVersion) Swap(i, j int) {
s[i], s[j] = s[j], s[i]
}
func (s SortVersion) Less(i, j int) bool {
v1 := fmt.Sprintf("v%s", s[i])
v2 := fmt.Sprintf("v%s", s[j])
return semver.Compare(v1, v2) == -1
}
-106
View File
@@ -1,106 +0,0 @@
package version
import (
"slices"
"testing"
"github.com/stretchr/testify/assert"
"golang.org/x/mod/semver"
)
func TestIsVersionGreaterOrEqualThan(t *testing.T) {
tests := []struct {
version string
target string
want bool
}{
{
version: "0.9.1",
target: "0.9.1",
want: true,
},
{
version: "0.10.0",
target: "0.9.1",
want: true,
},
{
version: "0.9.0",
target: "0.9.1",
want: false,
},
}
for _, test := range tests {
result := IsVersionGreaterOrEqualThan(test.version, test.target)
if result != test.want {
t.Errorf("got result %v, want %v.", result, test.want)
}
}
}
func TestIsVersionGreaterThan(t *testing.T) {
tests := []struct {
version string
target string
want bool
}{
{
version: "0.9.1",
target: "0.9.1",
want: false,
},
{
version: "0.10.0",
target: "0.8.0",
want: true,
},
{
version: "0.23",
target: "0.22",
want: true,
},
{
version: "0.8.0",
target: "0.10.0",
want: false,
},
{
version: "0.9.0",
target: "0.9.1",
want: false,
},
{
version: "0.22",
target: "0.22",
want: false,
},
}
for _, test := range tests {
result := IsVersionGreaterThan(test.version, test.target)
if result != test.want {
t.Errorf("got result %v, want %v.", result, test.want)
}
}
}
func TestSortVersion(t *testing.T) {
tests := []struct {
versionList []string
want []string
}{
{
versionList: []string{"0.9.1", "0.10.0", "0.8.0"},
want: []string{"0.8.0", "0.9.1", "0.10.0"},
},
{
versionList: []string{"1.9.1", "0.9.1", "0.10.0", "0.8.0"},
want: []string{"0.8.0", "0.9.1", "0.10.0", "1.9.1"},
},
}
for _, test := range tests {
slices.SortFunc(test.versionList, func(a, b string) int {
return semver.Compare("v"+a, "v"+b)
})
assert.Equal(t, test.versionList, test.want)
}
}
-37
View File
@@ -1,37 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"include-v-in-tag": true,
"include-component-in-tag": false,
"bump-minor-pre-major": true,
"versioning": "prerelease",
"prerelease": false,
"packages": {
".": {
"release-type": "go",
"package-name": "memos",
"changelog-path": "CHANGELOG.md",
"changelog-sections": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "perf",
"section": "Performance Improvements"
},
{
"type": "deps",
"section": "Dependencies"
},
{
"type": "revert",
"section": "Reverts"
}
]
}
}
}
+6 -3
View File
@@ -17,7 +17,7 @@ Usage:
install.sh [--version <version>] [--install-dir <dir>] [--repo <owner/name>] [--skip-checksum]
Environment:
MEMOS_VERSION Version to install. Accepts "0.28.1" or "v0.28.1". Defaults to latest release.
MEMOS_VERSION Version to install. Accepts "26.09" or "26.09.1". Defaults to latest release.
MEMOS_INSTALL_DIR Directory to install the binary into.
MEMOS_SKIP_CHECKSUM Set to 1 to skip checksum verification.
MEMOS_INSTALL_QUIET Set to 1 to reduce log output.
@@ -25,7 +25,7 @@ Environment:
Examples:
curl -fsSL https://raw.githubusercontent.com/usememos/memos/main/scripts/install.sh | sh
curl -fsSL https://raw.githubusercontent.com/usememos/memos/main/scripts/install.sh | sh -s -- --version 0.28.1
curl -fsSL https://raw.githubusercontent.com/usememos/memos/main/scripts/install.sh | sh -s -- --version 26.09
EOF
}
@@ -254,7 +254,10 @@ main() {
VERSION="$(normalize_version "$VERSION")"
install_dir="$(resolve_install_dir)"
tag="v${VERSION}"
case "$VERSION" in
0.*) tag="v${VERSION}" ;;
*) tag="$VERSION" ;;
esac
asset_suffix="${arch}"
if [ "$arch" = "armv7" ]; then
+79
View File
@@ -0,0 +1,79 @@
package scripts
import (
"crypto/sha256"
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
"github.com/stretchr/testify/require"
)
func TestInstallRelease(t *testing.T) {
for _, tc := range []struct{ input, tag string }{
{"26.09", "26.09"},
{"26.09.1", "26.09.1"},
{"v26.09.1", "26.09.1"},
{"26.09-rc.1", "26.09-rc.1"},
{"0.31.0", "v0.31.0"},
{"v0.31.0", "v0.31.0"},
{"", "26.09.2"},
{"", "v0.31.0"},
} {
input, tag := tc.input, tc.tag
t.Run("version="+input, func(t *testing.T) {
dir := t.TempDir()
mockBin := filepath.Join(dir, "bin")
require.NoError(t, os.Mkdir(mockBin, 0755))
version := strings.TrimPrefix(tag, "v")
writeExecutable(t, filepath.Join(dir, "memos"), "#!/bin/sh\nprintf '%s\\n' '"+version+"'\n")
archive := filepath.Join(dir, "release.tar.gz")
out, err := exec.Command("tar", "-czf", archive, "-C", dir, "memos").CombinedOutput()
require.NoError(t, err, string(out))
data, err := os.ReadFile(archive)
require.NoError(t, err)
asset := "memos_" + version + "_linux_amd64.tar.gz"
require.NoError(t, os.WriteFile(filepath.Join(dir, "checksums.txt"), []byte(fmt.Sprintf("%x %s\n", sha256.Sum256(data), asset)), 0644))
writeExecutable(t, filepath.Join(mockBin, "uname"), "#!/bin/sh\ncase $1 in -s) echo Linux;; -m) echo x86_64;; esac\n")
writeExecutable(t, filepath.Join(mockBin, "curl"), `#!/bin/sh
set -eu
url= dest=
while [ "$#" -gt 0 ]; do
case "$1" in
-o) dest="$2"; shift 2;;
-H) shift 2;;
-*) shift;;
*) url="$1"; shift;;
esac
done
printf '%s\n' "$url" >> "$TEST_DOWNLOAD_LOG"
case "$url" in
*/releases/latest) printf '{"tag_name":"%s"}\n' "$TEST_TAG";;
*/checksums.txt) cp "$TEST_FIXTURE/checksums.txt" "$dest";;
*/memos_*.tar.gz) cp "$TEST_FIXTURE/release.tar.gz" "$dest";;
*) exit 1;;
esac
`)
args := []string{"install.sh", "--install-dir", filepath.Join(dir, "installed")}
if input != "" {
args = append(args, "--version", input)
}
cmd := exec.Command("sh", args...)
logPath := filepath.Join(dir, "downloads.log")
cmd.Env = append(os.Environ(), "PATH="+mockBin+string(os.PathListSeparator)+os.Getenv("PATH"), "TEST_FIXTURE="+dir,
"TEST_TAG="+tag, "TEST_DOWNLOAD_LOG="+logPath, "MEMOS_VERSION=", "MEMOS_SKIP_CHECKSUM=0", "REPO=usememos/memos")
out, err = cmd.CombinedOutput()
require.NoError(t, err, string(out))
log, err := os.ReadFile(logPath)
require.NoError(t, err)
require.Contains(t, string(log), "https://github.com/usememos/memos/releases/download/"+tag+"/"+asset)
require.Contains(t, string(log), "/"+tag+"/checksums.txt")
out, err = exec.Command(filepath.Join(dir, "installed", "memos")).CombinedOutput()
require.NoError(t, err)
require.Equal(t, version+"\n", string(out))
})
}
}
+3 -21
View File
@@ -24,7 +24,7 @@ Docker image. With no options, the current worktree is built and tested.
Options:
--candidate-image IMAGE Test an existing image instead of building locally.
--previous-image IMAGE Image used to seed the upgrade test. By default, the
latest stable Git tag before HEAD is used.
latest supported stable Git tag before HEAD is used.
--keep-resources Keep containers and volumes after the test for debugging.
-h, --help Show this help text.
@@ -37,7 +37,7 @@ Examples:
./scripts/release_smoke_test.sh
./scripts/release_smoke_test.sh \
--candidate-image memos-smoke:local \
--previous-image neosmemo/memos:0.29.1
--previous-image neosmemo/memos:0.31.0
EOF
}
@@ -142,25 +142,7 @@ cleanup() {
trap cleanup EXIT
detect_previous_image() {
local head_sha tag tag_sha
head_sha="$(git -C "$REPO_ROOT" rev-parse HEAD)"
while IFS= read -r tag; do
case "$tag" in
*-rc.*) continue ;;
esac
tag_sha="$(git -C "$REPO_ROOT" rev-list -n 1 "$tag")"
if [[ "$tag_sha" == "$head_sha" ]]; then
continue
fi
if git -C "$REPO_ROOT" merge-base --is-ancestor "$tag" HEAD; then
printf 'neosmemo/memos:%s\n' "${tag#v}"
return
fi
done < <(git -C "$REPO_ROOT" tag --list 'v[0-9]*' --sort=-version:refname)
die "could not detect a previous stable release; pass --previous-image"
bash "$SCRIPT_DIR/release_version.sh" previous-image "$REPO_ROOT"
}
build_local_candidate() {
+87
View File
@@ -0,0 +1,87 @@
#!/usr/bin/env bash
set -euo pipefail
# Application releases use YY.MM[.N][-rc.N]. Database migration sequences are separate.
parse_release_tag() {
local tag="$1"
if [[ ! "$tag" =~ ^([1-9][0-9]\.(0[1-9]|1[0-2]))(\.([1-9][0-9]*))?(-rc\.([1-9][0-9]*))?$ ]]; then
return 1
fi
RELEASE_VERSION="$tag"
RELEASE_SERIES="${BASH_REMATCH[1]}"
RELEASE_IS_PRERELEASE=false
if [[ -n "${BASH_REMATCH[5]}" ]]; then
RELEASE_IS_PRERELEASE=true
fi
}
# previous_release_tag prints the newest stable release tag that is an ancestor
# of HEAD, excluding tags on HEAD itself. Legacy v0.31.x tags count because
# v0.31.0 is the fixed upgrade baseline.
previous_release_tag() {
local repo="$1" head_sha tag tag_sha
head_sha="$(git -C "$repo" rev-parse HEAD)"
# List calendar releases first: the legacy v prefix would otherwise sort ahead.
while IFS= read -r tag; do
if parse_release_tag "$tag"; then
[[ "$RELEASE_IS_PRERELEASE" == false ]] || continue
elif [[ ! "$tag" =~ ^v0\.31\.(0|[1-9][0-9]*)$ ]]; then
continue
fi
tag_sha="$(git -C "$repo" rev-list -n 1 "$tag")"
[[ "$tag_sha" != "$head_sha" ]] || continue
if git -C "$repo" merge-base --is-ancestor "$tag" HEAD; then
printf '%s\n' "$tag"
return
fi
done < <(
git -C "$repo" tag --list '[1-9][0-9].*' --sort=-version:refname
git -C "$repo" tag --list 'v0.31.*' --sort=-version:refname
)
echo 'No supported previous release found' >&2
return 1
}
previous_release_image() {
local tag
if ! tag="$(previous_release_tag "$1")"; then
echo 'Pass --previous-image' >&2
return 1
fi
printf 'neosmemo/memos:%s\n' "${tag#v}"
}
if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
case "${1:-}" in
previous-tag)
previous_release_tag "${2:?repository required}"
exit
;;
previous-image)
previous_release_image "${2:?repository required}"
exit
;;
esac
tag="${2:?release tag required}"
if ! parse_release_tag "$tag"; then
echo "Unsupported release tag format: $tag" >&2
exit 1
fi
case "${1:-}" in
version)
printf 'tag=%s\nversion=%s\nseries=%s\nis_prerelease=%s\n' \
"$tag" "$RELEASE_VERSION" "$RELEASE_SERIES" "$RELEASE_IS_PRERELEASE"
;;
image-tags)
printf '%s\n' "$RELEASE_VERSION"
if [[ "$RELEASE_IS_PRERELEASE" == false ]]; then
if [[ "$RELEASE_SERIES" != "$RELEASE_VERSION" ]]; then
printf '%s\n' "$RELEASE_SERIES"
fi
printf 'stable\n'
fi
;;
*) echo "Unknown release command: ${1:-}" >&2; exit 1 ;;
esac
fi
+95
View File
@@ -0,0 +1,95 @@
package scripts
import (
"os/exec"
"strings"
"testing"
"github.com/stretchr/testify/require"
)
func TestReleaseVersions(t *testing.T) {
for _, tc := range []struct {
tag, series, prerelease, images string
}{
{"26.09", "26.09", "false", "26.09\nstable\n"},
{"26.09.1", "26.09", "false", "26.09.1\n26.09\nstable\n"},
{"26.09.10", "26.09", "false", "26.09.10\n26.09\nstable\n"},
{"26.10.1", "26.10", "false", "26.10.1\n26.10\nstable\n"},
{"27.01", "27.01", "false", "27.01\nstable\n"},
{"26.09-rc.1", "26.09", "true", "26.09-rc.1\n"},
{"26.09.1-rc.2", "26.09", "true", "26.09.1-rc.2\n"},
} {
t.Run(tc.tag, func(t *testing.T) {
out, err := exec.Command("bash", "release_version.sh", "version", tc.tag).CombinedOutput()
require.NoError(t, err, string(out))
require.Equal(t, "tag="+tc.tag+"\nversion="+tc.tag+"\nseries="+tc.series+"\nis_prerelease="+tc.prerelease+"\n", string(out))
out, err = exec.Command("bash", "release_version.sh", "image-tags", tc.tag).CombinedOutput()
require.NoError(t, err, string(out))
require.Equal(t, tc.images, string(out))
})
}
for _, tag := range []string{"v0.31.0", "v26.09", "v26.09.1", "v26.09-rc.1", "26.9", "26.00", "26.13", "2026.09", "26.09.0", "26.09.01", "26.09-rc.0", "26.09-rc.01", "26.09beta", "26.09.1+build"} {
out, err := exec.Command("bash", "release_version.sh", "version", tag).CombinedOutput()
require.Error(t, err, tag)
require.Contains(t, string(out), "Unsupported release tag")
}
}
func TestPreviousReleaseImage(t *testing.T) {
repo := t.TempDir()
runGit := func(args ...string) {
t.Helper()
cmd := exec.Command("git", append([]string{"-C", repo, "-c", "user.name=Release Test", "-c", "user.email=test@example.com", "-c", "commit.gpgsign=false"}, args...)...)
out, err := cmd.CombinedOutput()
require.NoError(t, err, string(out))
}
check := func(want string) {
t.Helper()
out, err := exec.Command("bash", "release_version.sh", "previous-tag", repo).CombinedOutput()
require.NoError(t, err, string(out))
require.Equal(t, want+"\n", string(out))
out, err = exec.Command("bash", "release_version.sh", "previous-image", repo).CombinedOutput()
require.NoError(t, err, string(out))
require.Equal(t, "neosmemo/memos:"+strings.TrimPrefix(want, "v")+"\n", string(out))
}
runGit("init", "-b", "main")
runGit("commit", "--allow-empty", "-m", "old")
runGit("tag", "v0.30.0")
runGit("commit", "--allow-empty", "-m", "baseline")
runGit("tag", "v0.31.0")
runGit("commit", "--allow-empty", "-m", "first calendar release")
runGit("tag", "26.09")
check("v0.31.0")
runGit("commit", "--allow-empty", "-m", "point release")
runGit("tag", "26.09.2")
check("26.09")
runGit("commit", "--allow-empty", "-m", "tenth point release")
runGit("tag", "26.09.10")
runGit("tag", "99.99")
runGit("commit", "--allow-empty", "-m", "release candidate")
runGit("tag", "26.10-rc.1")
check("26.09.10")
runGit("commit", "--allow-empty", "-m", "after release candidate")
check("26.09.10")
runGit("checkout", "--orphan", "unrelated")
runGit("commit", "--allow-empty", "-m", "unrelated release")
runGit("tag", "29.01")
runGit("checkout", "main")
check("26.09.10")
runGit("tag", "26.10")
runGit("commit", "--allow-empty", "-m", "next year")
runGit("tag", "27.01")
check("26.10")
// The floor excludes pre-baseline tags even if no supported release exists.
repo = t.TempDir()
runGit("init", "-b", "main")
runGit("commit", "--allow-empty", "-m", "old")
runGit("tag", "v0.30.0")
runGit("commit", "--allow-empty", "-m", "candidate")
for _, command := range []string{"previous-tag", "previous-image"} {
out, err := exec.Command("bash", "release_version.sh", command, repo).CombinedOutput()
require.Error(t, err, command)
require.Contains(t, string(out), "No supported previous release found")
}
}
+29
View File
@@ -0,0 +1,29 @@
# Database migration baseline
The minimum supported database schema is **0.31.8**, shipped in **v0.31.0**.
This is a fixed baseline, independent of application release numbering.
- Fresh installations use the driver's `LATEST.sql` and record the current schema version.
- Existing databases below the baseline must first run
[v0.31.0](https://github.com/usememos/memos/releases/tag/v0.31.0) successfully.
- Databases older than v0.22, or with no schema version recorded, must first run
[v0.25.3](https://github.com/usememos/memos/releases/tag/v0.25.3), then v0.31.0.
- Invalid schema versions and databases newer than the binary supports are rejected.
Historical SemVer migration scripts are retained in Git history and released
binaries. They are no longer embedded in the current binary. Keep each driver's
`LATEST.sql` for fresh installations and add incremental migrations for future
schema changes across SQLite, MySQL, and PostgreSQL. Do not advance the baseline
when adding migrations; databases at 0.31.8 must remain upgradeable.
New migrations use `YY.MM/NN__description.sql`, where `NN` starts at `00`.
Each schema change ships one file per driver under the same `YY.MM/NN`; a
driver only records versions whose SQL it executed, and the store tests fail
when drivers disagree. Two files with the same `NN` in one month are rejected.
For example, `26.09/00__add_column.sql` records schema `26.9.1`; the next
migration records `26.9.2`. Compare year, month, and sequence numerically.
The sequence is independent of the application's release revision: a release
without schema changes keeps the existing schema version. Calendar schemas
sort after the legacy 0.x baseline. Migration directories keep months zero-padded
(`01` through `12`), while stored schema markers omit the padding. This lets older binaries' SemVer comparisons
recognize a calendar schema as newer and reject a downgrade.
-9
View File
@@ -1,9 +0,0 @@
-- inbox
CREATE TABLE `inbox` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`created_ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`sender_id` INT NOT NULL,
`receiver_id` INT NOT NULL,
`status` TEXT NOT NULL,
`message` TEXT NOT NULL
);
@@ -1 +0,0 @@
DELETE FROM `activity`;
@@ -1,3 +0,0 @@
ALTER TABLE `system_setting` MODIFY `value` LONGTEXT NOT NULL;
ALTER TABLE `user_setting` MODIFY `value` LONGTEXT NOT NULL;
ALTER TABLE `user` MODIFY `avatar_url` LONGTEXT NOT NULL;
@@ -1,10 +0,0 @@
-- webhook
CREATE TABLE `webhook` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`created_ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`row_status` VARCHAR(256) NOT NULL DEFAULT 'NORMAL',
`creator_id` INT NOT NULL,
`name` TEXT NOT NULL,
`url` TEXT NOT NULL
);
@@ -1,4 +0,0 @@
UPDATE `user_setting` SET `key` = 'USER_SETTING_LOCALE', `value` = REPLACE(`value`, '"', '') WHERE `key` = 'locale';
UPDATE `user_setting` SET `key` = 'USER_SETTING_APPEARANCE', `value` = REPLACE(`value`, '"', '') WHERE `key` = 'appearance';
UPDATE `user_setting` SET `key` = 'USER_SETTING_MEMO_VISIBILITY', `value` = REPLACE(`value`, '"', '') WHERE `key` = 'memo-visibility';
UPDATE `user_setting` SET `key` = 'USER_SETTING_TELEGRAM_USER_ID', `value` = REPLACE(`value`, '"', '') WHERE `key` = 'telegram-user-id';
@@ -1,15 +0,0 @@
ALTER TABLE `memo` ADD COLUMN `resource_name` VARCHAR(256) AFTER `id`;
UPDATE `memo` SET `resource_name` = uuid();
ALTER TABLE `memo` MODIFY COLUMN `resource_name` VARCHAR(256) NOT NULL;
CREATE UNIQUE INDEX idx_memo_resource_name ON `memo` (`resource_name`);
ALTER TABLE `resource` ADD COLUMN `resource_name` VARCHAR(256) AFTER `id`;
UPDATE `resource` SET `resource_name` = uuid();
ALTER TABLE `resource` MODIFY COLUMN `resource_name` VARCHAR(256) NOT NULL;
CREATE UNIQUE INDEX idx_resource_resource_name ON `resource` (`resource_name`);
@@ -1,9 +0,0 @@
-- reaction
CREATE TABLE `reaction` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`created_ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`creator_id` INT NOT NULL,
`content_id` VARCHAR(256) NOT NULL,
`reaction_type` VARCHAR(256) NOT NULL,
UNIQUE(`creator_id`,`content_id`,`reaction_type`)
);
@@ -1 +0,0 @@
ALTER TABLE `user` ADD COLUMN `description` VARCHAR(256) NOT NULL DEFAULT '';
@@ -1,3 +0,0 @@
ALTER TABLE `memo` RENAME COLUMN `resource_name` TO `uid`;
ALTER TABLE `resource` RENAME COLUMN `resource_name` TO `uid`;
@@ -1,11 +0,0 @@
ALTER TABLE `resource` ADD COLUMN `storage_type` VARCHAR(256) NOT NULL DEFAULT '';
ALTER TABLE `resource` ADD COLUMN `reference` VARCHAR(256) NOT NULL DEFAULT '';
ALTER TABLE `resource` ADD COLUMN `payload` TEXT NOT NULL;
UPDATE `resource` SET `payload` = '{}';
UPDATE `resource` SET `storage_type` = 'LOCAL', `reference` = `internal_path` WHERE `internal_path` IS NOT NULL AND `internal_path` != '';
UPDATE `resource` SET `storage_type` = 'EXTERNAL', `reference` = `external_link` WHERE `external_link` IS NOT NULL AND `external_link` != '';
ALTER TABLE `resource` DROP COLUMN `internal_path`;
ALTER TABLE `resource` DROP COLUMN `external_link`;
@@ -1,3 +0,0 @@
ALTER TABLE `memo` ADD COLUMN `tags_temp` JSON;
UPDATE `memo` SET `tags_temp` = '[]';
ALTER TABLE `memo` CHANGE COLUMN `tags_temp` `tags` JSON NOT NULL;
@@ -1,3 +0,0 @@
ALTER TABLE `memo` ADD COLUMN `payload_temp` JSON;
UPDATE `memo` SET `payload_temp` = '{}';
ALTER TABLE `memo` CHANGE COLUMN `payload_temp` `payload` JSON NOT NULL;
@@ -1 +0,0 @@
DROP TABLE IF EXISTS `tag`;
@@ -1,12 +0,0 @@
UPDATE `reaction` SET `reaction_type` = '👍' WHERE `reaction_type` = 'THUMBS_UP';
UPDATE `reaction` SET `reaction_type` = '👎' WHERE `reaction_type` = 'THUMBS_DOWN';
UPDATE `reaction` SET `reaction_type` = '💛' WHERE `reaction_type` = 'HEART';
UPDATE `reaction` SET `reaction_type` = '🔥' WHERE `reaction_type` = 'FIRE';
UPDATE `reaction` SET `reaction_type` = '👏' WHERE `reaction_type` = 'CLAPPING_HANDS';
UPDATE `reaction` SET `reaction_type` = '😂' WHERE `reaction_type` = 'LAUGH';
UPDATE `reaction` SET `reaction_type` = '👌' WHERE `reaction_type` = 'OK_HAND';
UPDATE `reaction` SET `reaction_type` = '🚀' WHERE `reaction_type` = 'ROCKET';
UPDATE `reaction` SET `reaction_type` = '👀' WHERE `reaction_type` = 'EYES';
UPDATE `reaction` SET `reaction_type` = '🤔' WHERE `reaction_type` = 'THINKING_FACE';
UPDATE `reaction` SET `reaction_type` = '🤡' WHERE `reaction_type` = 'CLOWN_FACE';
UPDATE `reaction` SET `reaction_type` = '❓' WHERE `reaction_type` = 'QUESTION_MARK';
-2
View File
@@ -1,2 +0,0 @@
-- Drop deprecated tags column.
ALTER TABLE `memo` DROP COLUMN `tags`;
@@ -1,8 +0,0 @@
-- Add pinned column.
ALTER TABLE `memo` ADD COLUMN `pinned` BOOLEAN NOT NULL DEFAULT FALSE;
-- Update pinned column from memo_organizer.
UPDATE memo
JOIN memo_organizer ON memo.id = memo_organizer.memo_id
SET memo.pinned = TRUE
WHERE memo_organizer.pinned = 1;
@@ -1,2 +0,0 @@
-- https://github.com/usememos/memos/issues/4322
ALTER TABLE `resource` MODIFY `reference` TEXT NOT NULL DEFAULT ('');
@@ -1 +0,0 @@
DROP TABLE IF EXISTS webhook;
@@ -1 +0,0 @@
RENAME TABLE resource TO attachment;
@@ -1 +0,0 @@
DROP TABLE IF EXISTS memo_organizer;
@@ -1 +0,0 @@
UPDATE `user` SET `role` = 'ADMIN' WHERE `role` = 'HOST';
@@ -1,6 +0,0 @@
-- Set storage type to DATABASE for existing instances that have no storage setting configured.
-- This preserves backward-compatible behavior before the default was changed to LOCAL.
INSERT INTO system_setting (name, value, description)
SELECT 'STORAGE', '{"storageType":"DATABASE"}', ''
FROM DUAL
WHERE NOT EXISTS (SELECT 1 FROM system_setting WHERE name = 'STORAGE');
@@ -1,8 +0,0 @@
-- Add uid column to idp table
ALTER TABLE `idp` ADD COLUMN `uid` VARCHAR(256) NOT NULL DEFAULT '';
-- Populate uid for existing rows using hex of id as a fallback
UPDATE `idp` SET `uid` = LOWER(LPAD(HEX(`id`), 8, '0')) WHERE `uid` = '';
-- Create unique index on uid
ALTER TABLE `idp` ADD UNIQUE INDEX `idx_idp_uid` (`uid`);
@@ -1,14 +0,0 @@
UPDATE `inbox` AS i
JOIN `activity` AS a
ON a.`id` = CAST(JSON_UNQUOTE(JSON_EXTRACT(i.`message`, '$.activityId')) AS UNSIGNED)
SET i.`message` = JSON_SET(
JSON_REMOVE(i.`message`, '$.activityId'),
'$.memoComment',
JSON_OBJECT(
'memoId',
JSON_EXTRACT(a.`payload`, '$.memoComment.memoId'),
'relatedMemoId',
JSON_EXTRACT(a.`payload`, '$.memoComment.relatedMemoId')
)
)
WHERE JSON_EXTRACT(i.`message`, '$.activityId') IS NOT NULL;
@@ -1 +0,0 @@
DROP TABLE `activity`;
@@ -1,14 +0,0 @@
-- memo_share stores per-memo share grants (one row per share link).
-- uid is the opaque bearer token included in the share URL.
-- ON DELETE CASCADE ensures grants are cleaned up when the parent memo is deleted.
CREATE TABLE memo_share (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
uid VARCHAR(255) NOT NULL UNIQUE,
memo_id INT NOT NULL,
creator_id INT NOT NULL,
created_ts BIGINT NOT NULL DEFAULT (UNIX_TIMESTAMP()),
expires_ts BIGINT DEFAULT NULL,
FOREIGN KEY (memo_id) REFERENCES memo(id) ON DELETE CASCADE
);
CREATE INDEX idx_memo_share_memo_id ON memo_share(memo_id);
@@ -1,15 +0,0 @@
-- user_identity stores the linkage between an external identity subject and a local user.
-- (provider, extern_uid) is unique across the table; provider stores the idp.uid.
-- Each local user can link at most one external account per provider.
CREATE TABLE `user_identity` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`user_id` INT NOT NULL,
`provider` VARCHAR(256) NOT NULL,
`extern_uid` VARCHAR(256) NOT NULL,
`created_ts` BIGINT NOT NULL DEFAULT (UNIX_TIMESTAMP()),
`updated_ts` BIGINT NOT NULL DEFAULT (UNIX_TIMESTAMP()),
UNIQUE (`provider`, `extern_uid`),
UNIQUE (`user_id`, `provider`)
);
CREATE INDEX `idx_user_identity_user_id` ON `user_identity`(`user_id`);
@@ -1,10 +0,0 @@
INSERT IGNORE INTO `user_setting` (`user_id`, `key`, `value`)
SELECT
`user`.`id`,
'TAGS',
`system_setting`.`value`
FROM `user`
JOIN `system_setting` ON `system_setting`.`name` = 'TAGS'
WHERE `system_setting`.`value` IS NOT NULL
AND `system_setting`.`value` != ''
AND `system_setting`.`value` != '{}';
@@ -1,29 +0,0 @@
-- Renames the SHORTCUTS user setting to MEMO_VIEWS, rewriting the stored JSON
-- object key from `shortcuts` to `memoViews` to match the renamed proto field.
--
-- Rows are skipped rather than failing the migration when either
-- * `value` is not valid JSON, which would abort the whole upgrade transaction, or
-- * the user already has a MEMO_VIEWS row, which would violate UNIQUE(user_id, key).
-- The conflict check goes through a derived table because MySQL cannot read the
-- target table of an UPDATE directly in a subquery.
UPDATE user_setting
SET
`key` = 'MEMO_VIEWS',
value = CASE
WHEN JSON_CONTAINS_PATH(value, 'one', '$.shortcuts') THEN JSON_SET(
JSON_REMOVE(value, '$.shortcuts'),
'$.memoViews',
JSON_EXTRACT(value, '$.shortcuts')
)
ELSE value
END
WHERE `key` = 'SHORTCUTS'
AND CASE
WHEN JSON_VALID(value) THEN JSON_TYPE(value) = 'OBJECT'
ELSE FALSE
END
AND user_id NOT IN (
SELECT user_id FROM (
SELECT user_id FROM user_setting WHERE `key` = 'MEMO_VIEWS'
) AS existing_memo_views
);
@@ -1,88 +0,0 @@
-- Expands the legacy singleton storage setting into the named storage model.
-- Legacy fields remain in place so older clients and rollback versions can
-- continue to read the active storage configuration.
UPDATE system_setting
SET value = JSON_SET(
value,
'$.storages', JSON_ARRAY(JSON_OBJECT(
'id', 'database',
'name', 'Database',
'type', 'STORAGE_TYPE_DATABASE'
)),
'$.defaultStorageId', 'database'
)
WHERE name = 'STORAGE'
AND CASE
WHEN JSON_VALID(value) THEN
JSON_TYPE(value) = 'OBJECT'
AND NOT JSON_CONTAINS_PATH(value, 'one', '$.storages')
AND JSON_UNQUOTE(JSON_EXTRACT(value, '$.storageType')) IN ('DATABASE', '1')
ELSE FALSE
END;
UPDATE system_setting
SET value = JSON_SET(
value,
'$.storages', JSON_ARRAY(JSON_OBJECT(
'id', 'local',
'name', 'Local',
'type', 'STORAGE_TYPE_LOCAL'
)),
'$.defaultStorageId', 'local'
)
WHERE name = 'STORAGE'
AND CASE
WHEN JSON_VALID(value) THEN
JSON_TYPE(value) = 'OBJECT'
AND NOT JSON_CONTAINS_PATH(value, 'one', '$.storages')
AND (
NOT JSON_CONTAINS_PATH(value, 'one', '$.storageType')
OR JSON_UNQUOTE(JSON_EXTRACT(value, '$.storageType')) IN ('STORAGE_TYPE_UNSPECIFIED', 'LOCAL', '0', '2')
)
ELSE FALSE
END;
UPDATE system_setting
SET value = JSON_SET(
value,
'$.storages', JSON_ARRAY(JSON_OBJECT(
'id', 's3',
'name', 'S3',
'type', 'STORAGE_TYPE_S3',
's3Config', JSON_EXTRACT(value, '$.s3Config')
)),
'$.defaultStorageId', 's3'
)
WHERE name = 'STORAGE'
AND CASE
WHEN JSON_VALID(value) THEN
JSON_TYPE(value) = 'OBJECT'
AND NOT JSON_CONTAINS_PATH(value, 'one', '$.storages')
AND JSON_UNQUOTE(JSON_EXTRACT(value, '$.storageType')) IN ('S3', '3')
AND JSON_TYPE(JSON_EXTRACT(value, '$.s3Config')) = 'OBJECT'
ELSE FALSE
END;
-- Attachments created before S3 configs were embedded only stored the object
-- key. Bind them to the namespace captured above before that default changes.
UPDATE attachment
SET payload = JSON_SET(payload, '$.s3Object.storageId', 's3')
WHERE storage_type = 'S3'
AND CASE
WHEN JSON_VALID(payload) THEN
JSON_TYPE(payload) = 'OBJECT'
AND JSON_TYPE(JSON_EXTRACT(payload, '$.s3Object')) = 'OBJECT'
AND NOT JSON_CONTAINS_PATH(payload, 'one', '$.s3Object.storageId')
AND NOT JSON_CONTAINS_PATH(payload, 'one', '$.s3Object.s3Config')
ELSE FALSE
END
AND EXISTS (
SELECT 1
FROM system_setting AS storage_setting
WHERE storage_setting.name = 'STORAGE'
AND CASE
WHEN JSON_VALID(storage_setting.value) THEN
JSON_UNQUOTE(JSON_EXTRACT(storage_setting.value, '$.defaultStorageId')) = 's3'
ELSE FALSE
END
);
@@ -1,18 +0,0 @@
-- Replaces the memo resource name stored in reaction.content_id with the
-- memo's stable internal ID. Rows that cannot be resolved are intentionally
-- deleted before memo_id is made non-nullable. Altering the table in place
-- preserves its AUTO_INCREMENT high-water mark.
ALTER TABLE `reaction`
ADD COLUMN `memo_id` INT DEFAULT NULL AFTER `creator_id`;
UPDATE `reaction`
JOIN `memo` ON `reaction`.`content_id` = CONCAT('memos/', `memo`.`uid`)
SET `reaction`.`memo_id` = `memo`.`id`;
DELETE FROM `reaction` WHERE `memo_id` IS NULL;
ALTER TABLE `reaction`
DROP INDEX `creator_id`,
DROP COLUMN `content_id`,
MODIFY COLUMN `memo_id` INT NOT NULL,
ADD UNIQUE (`creator_id`, `memo_id`, `reaction_type`);
@@ -1,20 +0,0 @@
CREATE TABLE `space` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`uid` VARCHAR(256) NOT NULL UNIQUE,
`title` TEXT NOT NULL,
`description` TEXT NOT NULL
);
CREATE TABLE `space_member` (
`space_id` INT NOT NULL,
`user_id` INT NOT NULL,
`role` VARCHAR(256) NOT NULL CHECK (`role` IN ('ADMIN', 'USER')),
PRIMARY KEY (`space_id`, `user_id`)
);
ALTER TABLE `memo` ADD COLUMN `space_id` INT DEFAULT NULL;
CREATE INDEX `idx_space_member_user_id` ON `space_member`(`user_id`, `space_id`);
CREATE INDEX `idx_memo_space_id` ON `memo`(`space_id`, `row_status`, `created_ts`, `id`);
CREATE INDEX `idx_memo_relation_related_type_memo`
ON `memo_relation`(`related_memo_id`, `type`, `memo_id`);
@@ -1,8 +0,0 @@
ALTER TABLE `space_member`
ADD COLUMN `status` VARCHAR(256) NULL AFTER `user_id`;
UPDATE `space_member`
SET `status` = 'ACTIVE';
ALTER TABLE `space_member`
MODIFY COLUMN `status` VARCHAR(256) NOT NULL;
@@ -1,2 +0,0 @@
ALTER TABLE `user`
MODIFY `username` VARCHAR(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL;
@@ -1,3 +0,0 @@
ALTER TABLE space ADD COLUMN payload JSON;
UPDATE space SET payload = '{}';
ALTER TABLE space MODIFY COLUMN payload JSON NOT NULL;
@@ -1,42 +0,0 @@
-- Make user.email an optional, canonical, instance-unique attribute.
-- The column is switched to a binary collation before the data repair so
-- that grouping compares bytes rather than whatever the server default
-- collation considers equal.
ALTER TABLE `user`
MODIFY `email` VARCHAR(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL;
-- Canonical form: trimmed and lowercased.
UPDATE `user` SET `email` = LOWER(TRIM(`email`));
-- Empty values, values without an '@', and values carrying display-name
-- syntax or interior whitespace mean no address.
UPDATE `user` SET `email` = NULL
WHERE `email` = '' OR `email` NOT LIKE '%@%' OR `email` LIKE '%<%' OR `email` LIKE '%>%' OR `email` LIKE '% %';
-- For each address held by more than one account, the oldest account keeps it.
-- MySQL cannot read the table being updated in a subquery, so the survivors
-- are materialized through a derived table.
UPDATE `user`
SET `email` = NULL
WHERE `email` IS NOT NULL
AND `id` NOT IN (
SELECT `id` FROM (
SELECT MIN(`id`) AS `id` FROM `user` WHERE `email` IS NOT NULL GROUP BY `email`
) AS `keep`
);
-- MySQL has no CREATE INDEX IF NOT EXISTS; guard through a prepared statement
-- so that re-running this file against a database that already carries the
-- index (a fresh install whose schema version was rewound) is a no-op.
SET @idx_user_email_exists = (
SELECT COUNT(*) FROM information_schema.statistics
WHERE table_schema = DATABASE() AND table_name = 'user' AND index_name = 'idx_user_email'
);
SET @idx_user_email_stmt = IF(
@idx_user_email_exists = 0,
'CREATE UNIQUE INDEX `idx_user_email` ON `user` (`email`)',
'SELECT 1'
);
PREPARE idx_user_email_prepared FROM @idx_user_email_stmt;
EXECUTE idx_user_email_prepared;
DEALLOCATE PREPARE idx_user_email_prepared;
@@ -1,15 +0,0 @@
ALTER TABLE memo ADD COLUMN resource_name TEXT;
UPDATE memo SET resource_name = uuid_in(md5(random()::text || random()::text)::cstring);
ALTER TABLE memo ALTER COLUMN resource_name SET NOT NULL;
CREATE UNIQUE INDEX idx_memo_resource_name ON memo (resource_name);
ALTER TABLE resource ADD COLUMN resource_name TEXT;
UPDATE resource SET resource_name = uuid_in(md5(random()::text || random()::text)::cstring);
ALTER TABLE resource ALTER COLUMN resource_name SET NOT NULL;
CREATE UNIQUE INDEX idx_resource_resource_name ON resource (resource_name);
@@ -1,9 +0,0 @@
-- reaction
CREATE TABLE reaction (
id SERIAL PRIMARY KEY,
created_ts BIGINT NOT NULL DEFAULT EXTRACT(EPOCH FROM NOW()),
creator_id INTEGER NOT NULL,
content_id TEXT NOT NULL,
reaction_type TEXT NOT NULL,
UNIQUE(creator_id, content_id, reaction_type)
);
@@ -1 +0,0 @@
ALTER TABLE "user" ADD COLUMN description TEXT NOT NULL DEFAULT '';
@@ -1,3 +0,0 @@
ALTER TABLE memo RENAME COLUMN resource_name TO uid;
ALTER TABLE resource RENAME COLUMN resource_name TO uid;
@@ -1,11 +0,0 @@
ALTER TABLE resource ADD COLUMN storage_type TEXT NOT NULL DEFAULT '';
ALTER TABLE resource ADD COLUMN reference TEXT NOT NULL DEFAULT '';
ALTER TABLE resource ADD COLUMN payload TEXT NOT NULL DEFAULT '{}';
UPDATE resource SET storage_type = 'LOCAL', reference = internal_path WHERE internal_path IS NOT NULL AND internal_path != '';
UPDATE resource SET storage_type = 'EXTERNAL', reference = external_link WHERE external_link IS NOT NULL AND external_link != '';
ALTER TABLE resource DROP COLUMN internal_path;
ALTER TABLE resource DROP COLUMN external_link;
@@ -1 +0,0 @@
ALTER TABLE memo ADD COLUMN tags JSONB NOT NULL DEFAULT '[]';
@@ -1 +0,0 @@
ALTER TABLE memo ADD COLUMN payload JSONB NOT NULL DEFAULT '{}';
@@ -1 +0,0 @@
DROP TABLE IF EXISTS tag;
@@ -1,12 +0,0 @@
UPDATE "reaction" SET "reaction_type" = '👍' WHERE "reaction_type" = 'THUMBS_UP';
UPDATE "reaction" SET "reaction_type" = '👎' WHERE "reaction_type" = 'THUMBS_DOWN';
UPDATE "reaction" SET "reaction_type" = '💛' WHERE "reaction_type" = 'HEART';
UPDATE "reaction" SET "reaction_type" = '🔥' WHERE "reaction_type" = 'FIRE';
UPDATE "reaction" SET "reaction_type" = '👏' WHERE "reaction_type" = 'CLAPPING_HANDS';
UPDATE "reaction" SET "reaction_type" = '😂' WHERE "reaction_type" = 'LAUGH';
UPDATE "reaction" SET "reaction_type" = '👌' WHERE "reaction_type" = 'OK_HAND';
UPDATE "reaction" SET "reaction_type" = '🚀' WHERE "reaction_type" = 'ROCKET';
UPDATE "reaction" SET "reaction_type" = '👀' WHERE "reaction_type" = 'EYES';
UPDATE "reaction" SET "reaction_type" = '🤔' WHERE "reaction_type" = 'THINKING_FACE';
UPDATE "reaction" SET "reaction_type" = '🤡' WHERE "reaction_type" = 'CLOWN_FACE';
UPDATE "reaction" SET "reaction_type" = '❓' WHERE "reaction_type" = 'QUESTION_MARK';
@@ -1,2 +0,0 @@
-- Drop deprecated tags column.
ALTER TABLE memo DROP COLUMN IF EXISTS tags;
@@ -1,8 +0,0 @@
-- Add pinned column.
ALTER TABLE memo ADD COLUMN pinned BOOLEAN NOT NULL DEFAULT FALSE;
-- Update pinned column from memo_organizer.
UPDATE memo
SET pinned = TRUE
FROM memo_organizer
WHERE memo.id = memo_organizer.memo_id AND memo_organizer.pinned = 1;
@@ -1 +0,0 @@
DROP TABLE IF EXISTS webhook;
@@ -1 +0,0 @@
ALTER TABLE resource RENAME TO attachment;
@@ -1 +0,0 @@
DROP TABLE IF EXISTS memo_organizer;
@@ -1 +0,0 @@
UPDATE "user" SET role = 'ADMIN' WHERE role = 'HOST';
@@ -1,5 +0,0 @@
-- Set storage type to DATABASE for existing instances that have no storage setting configured.
-- This preserves backward-compatible behavior before the default was changed to LOCAL.
INSERT INTO system_setting (name, value, description)
SELECT 'STORAGE', '{"storageType":"DATABASE"}', ''
WHERE NOT EXISTS (SELECT 1 FROM system_setting WHERE name = 'STORAGE');
@@ -1,8 +0,0 @@
-- Add uid column to idp table
ALTER TABLE idp ADD COLUMN uid TEXT NOT NULL DEFAULT '';
-- Populate uid for existing rows using hex of id as a fallback
UPDATE idp SET uid = LPAD(TO_HEX(id), 8, '0') WHERE uid = '';
-- Create unique index on uid
CREATE UNIQUE INDEX IF NOT EXISTS idx_idp_uid ON idp (uid);
@@ -1,13 +0,0 @@
UPDATE inbox AS i
SET message = jsonb_set(
i.message::jsonb - 'activityId',
'{memoComment}',
jsonb_build_object(
'memoId',
a.payload->'memoComment'->'memoId',
'relatedMemoId',
a.payload->'memoComment'->'relatedMemoId'
)
)::text
FROM activity AS a
WHERE (i.message::jsonb->>'activityId')::integer = a.id;
@@ -1 +0,0 @@
DROP TABLE activity;
@@ -1,14 +0,0 @@
-- memo_share stores per-memo share grants (one row per share link).
-- uid is the opaque bearer token included in the share URL.
-- ON DELETE CASCADE ensures grants are cleaned up when the parent memo is deleted.
CREATE TABLE memo_share (
id SERIAL PRIMARY KEY,
uid TEXT NOT NULL UNIQUE,
memo_id INTEGER NOT NULL,
creator_id INTEGER NOT NULL,
created_ts BIGINT NOT NULL DEFAULT EXTRACT(EPOCH FROM NOW()),
expires_ts BIGINT DEFAULT NULL,
FOREIGN KEY (memo_id) REFERENCES memo(id) ON DELETE CASCADE
);
CREATE INDEX idx_memo_share_memo_id ON memo_share(memo_id);
@@ -1,15 +0,0 @@
-- user_identity stores the linkage between an external identity subject and a local user.
-- (provider, extern_uid) is unique across the table; provider stores the idp.uid.
-- Each local user can link at most one external account per provider.
CREATE TABLE user_identity (
id SERIAL PRIMARY KEY,
user_id INTEGER NOT NULL,
provider TEXT NOT NULL,
extern_uid TEXT NOT NULL,
created_ts BIGINT NOT NULL DEFAULT EXTRACT(EPOCH FROM NOW()),
updated_ts BIGINT NOT NULL DEFAULT EXTRACT(EPOCH FROM NOW()),
UNIQUE (provider, extern_uid),
UNIQUE (user_id, provider)
);
CREATE INDEX idx_user_identity_user_id ON user_identity(user_id);
@@ -1,11 +0,0 @@
INSERT INTO user_setting (user_id, key, value)
SELECT
"user".id,
'TAGS',
system_setting.value
FROM "user"
JOIN system_setting ON system_setting.name = 'TAGS'
WHERE system_setting.value IS NOT NULL
AND system_setting.value != ''
AND system_setting.value != '{}'
ON CONFLICT (user_id, key) DO NOTHING;
@@ -1,28 +0,0 @@
-- Renames the SHORTCUTS user setting to MEMO_VIEWS, rewriting the stored JSON
-- object key from `shortcuts` to `memoViews` to match the renamed proto field.
--
-- Invalid or non-object JSON values are skipped rather than aborting the upgrade,
-- while the conflict check preserves an existing MEMO_VIEWS setting.
UPDATE user_setting AS legacy
SET
key = 'MEMO_VIEWS',
value = CASE
WHEN legacy.value::jsonb ? 'shortcuts' THEN jsonb_set(
legacy.value::jsonb - 'shortcuts',
'{memoViews}',
legacy.value::jsonb->'shortcuts'
)::text
ELSE legacy.value
END
WHERE legacy.key = 'SHORTCUTS'
AND CASE
WHEN pg_input_is_valid(legacy.value, 'jsonb')
THEN jsonb_typeof(legacy.value::jsonb) = 'object'
ELSE FALSE
END
AND NOT EXISTS (
SELECT 1
FROM user_setting AS existing
WHERE existing.user_id = legacy.user_id
AND existing.key = 'MEMO_VIEWS'
);
@@ -1,104 +0,0 @@
-- Expands the legacy singleton storage setting into the named storage model.
-- Legacy fields remain in place so older clients and rollback versions can
-- continue to read the active storage configuration.
UPDATE system_setting
SET value = jsonb_set(
jsonb_set(
value::jsonb,
'{storages}',
jsonb_build_array(jsonb_build_object(
'id', 'database',
'name', 'Database',
'type', 'STORAGE_TYPE_DATABASE'
))
),
'{defaultStorageId}',
to_jsonb('database'::text)
)::text
WHERE name = 'STORAGE'
AND CASE
WHEN pg_input_is_valid(value, 'jsonb') THEN
jsonb_typeof(value::jsonb) = 'object'
AND NOT value::jsonb ? 'storages'
AND value::jsonb->>'storageType' IN ('DATABASE', '1')
ELSE FALSE
END;
UPDATE system_setting
SET value = jsonb_set(
jsonb_set(
value::jsonb,
'{storages}',
jsonb_build_array(jsonb_build_object(
'id', 'local',
'name', 'Local',
'type', 'STORAGE_TYPE_LOCAL'
))
),
'{defaultStorageId}',
to_jsonb('local'::text)
)::text
WHERE name = 'STORAGE'
AND CASE
WHEN pg_input_is_valid(value, 'jsonb') THEN
jsonb_typeof(value::jsonb) = 'object'
AND NOT value::jsonb ? 'storages'
AND (
NOT value::jsonb ? 'storageType'
OR value::jsonb->>'storageType' IN ('STORAGE_TYPE_UNSPECIFIED', 'LOCAL', '0', '2')
)
ELSE FALSE
END;
UPDATE system_setting
SET value = jsonb_set(
jsonb_set(
value::jsonb,
'{storages}',
jsonb_build_array(jsonb_build_object(
'id', 's3',
'name', 'S3',
'type', 'STORAGE_TYPE_S3',
's3Config', value::jsonb->'s3Config'
))
),
'{defaultStorageId}',
to_jsonb('s3'::text)
)::text
WHERE name = 'STORAGE'
AND CASE
WHEN pg_input_is_valid(value, 'jsonb') THEN
jsonb_typeof(value::jsonb) = 'object'
AND NOT value::jsonb ? 'storages'
AND value::jsonb->>'storageType' IN ('S3', '3')
AND jsonb_typeof(value::jsonb->'s3Config') = 'object'
ELSE FALSE
END;
-- Attachments created before S3 configs were embedded only stored the object
-- key. Bind them to the namespace captured above before that default changes.
UPDATE attachment
SET payload = jsonb_set(
payload::jsonb,
'{s3Object,storageId}',
to_jsonb('s3'::text)
)::text
WHERE storage_type = 'S3'
AND CASE
WHEN pg_input_is_valid(payload, 'jsonb') THEN
jsonb_typeof(payload::jsonb) = 'object'
AND jsonb_typeof(payload::jsonb->'s3Object') = 'object'
AND NOT payload::jsonb->'s3Object' ? 'storageId'
AND NOT payload::jsonb->'s3Object' ? 's3Config'
ELSE FALSE
END
AND EXISTS (
SELECT 1
FROM system_setting AS storage_setting
WHERE storage_setting.name = 'STORAGE'
AND CASE
WHEN pg_input_is_valid(storage_setting.value, 'jsonb') THEN
storage_setting.value::jsonb->>'defaultStorageId' = 's3'
ELSE FALSE
END
);
@@ -1,17 +0,0 @@
-- Replaces the memo resource name stored in reaction.content_id with the
-- memo's stable internal ID. Rows that cannot be resolved are intentionally
-- deleted before memo_id is made non-nullable.
ALTER TABLE reaction ADD COLUMN memo_id INTEGER;
UPDATE reaction
SET memo_id = memo.id
FROM memo
WHERE reaction.content_id = 'memos/' || memo.uid;
DELETE FROM reaction WHERE memo_id IS NULL;
ALTER TABLE reaction
DROP CONSTRAINT reaction_creator_id_content_id_reaction_type_key,
DROP COLUMN content_id,
ALTER COLUMN memo_id SET NOT NULL,
ADD UNIQUE (creator_id, memo_id, reaction_type);
@@ -1,20 +0,0 @@
CREATE TABLE space (
id SERIAL PRIMARY KEY,
uid TEXT NOT NULL UNIQUE,
title TEXT NOT NULL,
description TEXT NOT NULL DEFAULT ''
);
CREATE TABLE space_member (
space_id INTEGER NOT NULL,
user_id INTEGER NOT NULL,
role TEXT NOT NULL CHECK (role IN ('ADMIN', 'USER')),
PRIMARY KEY (space_id, user_id)
);
ALTER TABLE memo ADD COLUMN space_id INTEGER DEFAULT NULL;
CREATE INDEX idx_space_member_user_id ON space_member(user_id, space_id);
CREATE INDEX idx_memo_space_id ON memo(space_id, row_status, created_ts DESC, id DESC);
CREATE INDEX idx_memo_relation_related_type_memo
ON memo_relation(related_memo_id, type, memo_id);
@@ -1,8 +0,0 @@
ALTER TABLE space_member
ADD COLUMN status TEXT;
UPDATE space_member
SET status = 'ACTIVE';
ALTER TABLE space_member
ALTER COLUMN status SET NOT NULL;
@@ -1,2 +0,0 @@
ALTER TABLE "user"
ALTER COLUMN username TYPE TEXT COLLATE "C";
@@ -1 +0,0 @@
ALTER TABLE space ADD COLUMN payload JSONB NOT NULL DEFAULT '{}';
@@ -1,21 +0,0 @@
-- Make user.email an optional, canonical, instance-unique attribute.
ALTER TABLE "user"
ALTER COLUMN email DROP NOT NULL,
ALTER COLUMN email DROP DEFAULT,
ALTER COLUMN email TYPE TEXT COLLATE "C";
-- Canonical form: trimmed and lowercased.
UPDATE "user" SET email = LOWER(TRIM(email));
-- Empty values, values without an '@', and values carrying display-name
-- syntax or interior whitespace mean no address.
UPDATE "user" SET email = NULL
WHERE email = '' OR email NOT LIKE '%@%' OR email LIKE '%<%' OR email LIKE '%>%' OR email LIKE '% %';
-- For each address held by more than one account, the oldest account keeps it.
UPDATE "user"
SET email = NULL
WHERE email IS NOT NULL
AND id NOT IN (SELECT MIN(id) FROM "user" WHERE email IS NOT NULL GROUP BY email);
CREATE UNIQUE INDEX IF NOT EXISTS idx_user_email ON "user" (email);
@@ -1,9 +0,0 @@
-- activity
CREATE TABLE activity (
id INTEGER PRIMARY KEY AUTOINCREMENT,
creator_id INTEGER NOT NULL,
created_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),
type TEXT NOT NULL DEFAULT '',
level TEXT NOT NULL CHECK (level IN ('INFO', 'WARN', 'ERROR')) DEFAULT 'INFO',
payload TEXT NOT NULL DEFAULT '{}'
);
@@ -1,4 +0,0 @@
ALTER TABLE
user
ADD
COLUMN avatar_url TEXT NOT NULL DEFAULT '';
-8
View File
@@ -1,8 +0,0 @@
-- idp
CREATE TABLE idp (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
type TEXT NOT NULL,
identifier_filter TEXT NOT NULL DEFAULT '',
config TEXT NOT NULL DEFAULT '{}'
);
@@ -1,7 +0,0 @@
-- storage
CREATE TABLE storage (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
type TEXT NOT NULL,
config TEXT NOT NULL DEFAULT '{}'
);
@@ -1,6 +0,0 @@
UPDATE
user_setting
SET
key = 'memo-visibility'
WHERE
key = 'memoVisibility';
@@ -1,69 +0,0 @@
UPDATE
system_setting
SET
name = 'server-id'
WHERE
name = 'serverId';
UPDATE
system_setting
SET
name = 'secret-session'
WHERE
name = 'secretSessionName';
UPDATE
system_setting
SET
name = 'allow-signup'
WHERE
name = 'allowSignUp';
UPDATE
system_setting
SET
name = 'disable-public-memos'
WHERE
name = 'disablePublicMemos';
UPDATE
system_setting
SET
name = 'additional-style'
WHERE
name = 'additionalStyle';
UPDATE
system_setting
SET
name = 'additional-script'
WHERE
name = 'additionalScript';
UPDATE
system_setting
SET
name = 'customized-profile'
WHERE
name = 'customizedProfile';
UPDATE
system_setting
SET
name = 'storage-service-id'
WHERE
name = 'storageServiceId';
UPDATE
system_setting
SET
name = 'local-storage-path'
WHERE
name = 'localStoragePath';
UPDATE
system_setting
SET
name = 'openai-config'
WHERE
name = 'openAIConfig';
@@ -1,4 +0,0 @@
ALTER TABLE
resource
ADD
COLUMN internal_path TEXT NOT NULL DEFAULT '';
@@ -1,18 +0,0 @@
ALTER TABLE
resource
ADD
COLUMN public_id TEXT NOT NULL DEFAULT '';
CREATE UNIQUE INDEX resource_id_public_id_unique_index ON resource (id, public_id);
UPDATE
resource
SET
public_id = printf (
'%s-%s-%s-%s-%s',
lower(hex(randomblob(4))),
lower(hex(randomblob(2))),
lower(hex(randomblob(2))),
lower(hex(randomblob(2))),
lower(hex(randomblob(6)))
);
@@ -1,7 +0,0 @@
-- memo_relation
CREATE TABLE memo_relation (
memo_id INTEGER NOT NULL,
related_memo_id INTEGER NOT NULL,
type TEXT NOT NULL,
UNIQUE(memo_id, related_memo_id, type)
);
@@ -1,22 +0,0 @@
DROP TABLE IF EXISTS memo_organizer_temp;
CREATE TABLE memo_organizer_temp (
memo_id INTEGER NOT NULL,
user_id INTEGER NOT NULL,
pinned INTEGER NOT NULL CHECK (pinned IN (0, 1)) DEFAULT 0,
UNIQUE(memo_id, user_id)
);
INSERT INTO
memo_organizer_temp (memo_id, user_id, pinned)
SELECT
memo_id,
user_id,
pinned
FROM
memo_organizer;
DROP TABLE memo_organizer;
ALTER TABLE
memo_organizer_temp RENAME TO memo_organizer;
@@ -1,25 +0,0 @@
DROP TABLE IF EXISTS resource_temp;
CREATE TABLE resource_temp (
id INTEGER PRIMARY KEY AUTOINCREMENT,
creator_id INTEGER NOT NULL,
created_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),
updated_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),
filename TEXT NOT NULL DEFAULT '',
blob BLOB DEFAULT NULL,
external_link TEXT NOT NULL DEFAULT '',
type TEXT NOT NULL DEFAULT '',
size INTEGER NOT NULL DEFAULT 0,
internal_path TEXT NOT NULL DEFAULT ''
);
INSERT INTO
resource_temp (id, creator_id, created_ts, updated_ts, filename, blob, external_link, type, size, internal_path)
SELECT
id, creator_id, created_ts, updated_ts, filename, blob, external_link, type, size, internal_path
FROM
resource;
DROP TABLE resource;
ALTER TABLE resource_temp RENAME TO resource;
@@ -1,5 +0,0 @@
CREATE INDEX IF NOT EXISTS idx_user_username ON user (username);
CREATE INDEX IF NOT EXISTS idx_memo_creator_id ON memo (creator_id);
CREATE INDEX IF NOT EXISTS idx_memo_content ON memo (content);
CREATE INDEX IF NOT EXISTS idx_memo_visibility ON memo (visibility);
CREATE INDEX IF NOT EXISTS idx_resource_creator_id ON resource (creator_id);
@@ -1,25 +0,0 @@
DROP TABLE IF EXISTS user_temp;
CREATE TABLE user_temp (
id INTEGER PRIMARY KEY AUTOINCREMENT,
created_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),
updated_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),
row_status TEXT NOT NULL CHECK (row_status IN ('NORMAL', 'ARCHIVED')) DEFAULT 'NORMAL',
username TEXT NOT NULL UNIQUE,
role TEXT NOT NULL CHECK (role IN ('HOST', 'ADMIN', 'USER')) DEFAULT 'USER',
email TEXT NOT NULL DEFAULT '',
nickname TEXT NOT NULL DEFAULT '',
password_hash TEXT NOT NULL,
avatar_url TEXT NOT NULL DEFAULT ''
);
INSERT INTO
user_temp (id, created_ts, updated_ts, row_status, username, role, email, nickname, password_hash, avatar_url)
SELECT
id, created_ts, updated_ts, row_status, username, role, email, nickname, password_hash, avatar_url
FROM
user;
DROP TABLE user;
ALTER TABLE user_temp RENAME TO user;
@@ -1,13 +0,0 @@
ALTER TABLE resource ADD COLUMN memo_id INTEGER;
UPDATE resource
SET memo_id = (
SELECT memo_id
FROM memo_resource
WHERE resource.id = memo_resource.resource_id
LIMIT 1
);
CREATE INDEX idx_resource_memo_id ON resource (memo_id);
DROP TABLE IF EXISTS memo_resource;
@@ -1 +0,0 @@
DROP TABLE IF EXISTS shortcut;
@@ -1,9 +0,0 @@
-- inbox
CREATE TABLE inbox (
id INTEGER PRIMARY KEY AUTOINCREMENT,
created_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),
sender_id INTEGER NOT NULL,
receiver_id INTEGER NOT NULL,
status TEXT NOT NULL,
message TEXT NOT NULL DEFAULT '{}'
);
@@ -1 +0,0 @@
DELETE FROM activity;

Some files were not shown because too many files have changed in this diff Show More