Compare commits

...

2 Commits

Author SHA1 Message Date
Innei 577c8e2869 🗃️ feat(database): add page shares schema 2026-05-20 16:00:00 +08:00
lobehubbot 694a25822f 🔖 chore(release): release version v2.2.0 [skip ci] 2026-05-18 04:43:53 +00:00
10 changed files with 16005 additions and 1 deletions
+33
View File
@@ -2,6 +2,39 @@
# Changelog
### [Version 2.2.0](https://github.com/lobehub/lobe-chat/compare/v2.1.59-canary.27...v2.2.0)
<sup>Released on **2026-05-18**</sup>
#### 💄 Styles
- **pricing**: restore DeepSeek models to official pricing.
#### 🐛 Bug Fixes
- **conversation**: animate only the last markdown block + drop clearMessages hotkey.
<br/>
<details>
<summary><kbd>Improvements and Fixes</kbd></summary>
#### Styles
- **pricing**: restore DeepSeek models to official pricing, closes [#14911](https://github.com/lobehub/lobe-chat/issues/14911) ([e566688](https://github.com/lobehub/lobe-chat/commit/e566688))
#### What's fixed
- **conversation**: animate only the last markdown block + drop clearMessages hotkey, closes [#14906](https://github.com/lobehub/lobe-chat/issues/14906) ([469a8e6](https://github.com/lobehub/lobe-chat/commit/469a8e6))
</details>
<div align="right">
[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
</div>
## [Version 2.1.58](https://github.com/lobehub/lobe-chat/compare/v2.1.57...v2.1.58)
<sup>Released on **2026-05-13**</sup>
+5
View File
@@ -1,4 +1,9 @@
[
{
"children": {},
"date": "2026-05-18",
"version": "2.2.0"
},
{
"children": {
"features": [
+20
View File
@@ -1212,6 +1212,22 @@ table oidc_sessions {
}
}
table page_shares {
id text [pk, not null]
document_id text [not null]
user_id text [not null]
visibility text [not null, default: 'private']
page_view_count integer [not null, default: 0]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
document_id [name: 'page_shares_document_id_unique', unique]
user_id [name: 'page_shares_user_id_idx']
}
}
table chunks {
id uuid [pk, not null, default: `gen_random_uuid()`]
text text
@@ -2167,6 +2183,10 @@ ref: threads.source_message_id - messages.id
ref: messages.message_group_id > message_groups.id
ref: page_shares.document_id > documents.id
ref: page_shares.user_id - users.id
ref: sessions.group_id - session_groups.id
ref: topic_documents.document_id > documents.id
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@lobehub/lobehub",
"version": "2.1.58",
"version": "2.2.0",
"description": "LobeHub - an open-source,comprehensive AI Agent framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
"keywords": [
"framework",
@@ -0,0 +1,22 @@
CREATE TABLE IF NOT EXISTS "page_shares" (
"id" text PRIMARY KEY NOT NULL,
"document_id" text NOT NULL,
"user_id" text NOT NULL,
"visibility" text DEFAULT 'private' NOT NULL,
"page_view_count" integer DEFAULT 0 NOT NULL,
"accessed_at" timestamp with time zone DEFAULT now() NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "page_shares" DROP CONSTRAINT IF EXISTS "page_shares_document_id_documents_id_fk";
--> statement-breakpoint
ALTER TABLE "page_shares" ADD CONSTRAINT "page_shares_document_id_documents_id_fk" FOREIGN KEY ("document_id") REFERENCES "public"."documents"("id") ON DELETE cascade ON UPDATE no action;
--> statement-breakpoint
ALTER TABLE "page_shares" DROP CONSTRAINT IF EXISTS "page_shares_user_id_users_id_fk";
--> statement-breakpoint
ALTER TABLE "page_shares" ADD CONSTRAINT "page_shares_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS "page_shares_document_id_unique" ON "page_shares" USING btree ("document_id");
--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "page_shares_user_id_idx" ON "page_shares" USING btree ("user_id");
File diff suppressed because it is too large Load Diff
@@ -721,6 +721,13 @@
"when": 1778602304603,
"tag": "0102_add_agent_operations_table",
"breakpoints": true
},
{
"idx": 103,
"version": "7",
"when": 1779263513902,
"tag": "0103_add_page_shares",
"breakpoints": true
}
],
"version": "6"
+1
View File
@@ -19,6 +19,7 @@ export * from './messengerInstallation';
export * from './nextauth';
export * from './notification';
export * from './oidc';
export * from './pageShare';
export * from './rag';
export * from './ragEvals';
export * from './rbac';
@@ -0,0 +1,39 @@
import { index, integer, pgTable, text, uniqueIndex } from 'drizzle-orm/pg-core';
import { createNanoId } from '../utils/idGenerator';
import { timestamps } from './_helpers';
import { documents } from './file';
import { users } from './user';
/**
* Page sharing table - Manages public sharing links for documents/pages.
*/
export const pageShares = pgTable(
'page_shares',
{
id: text('id')
.$defaultFn(() => createNanoId(8)())
.primaryKey(),
documentId: text('document_id')
.notNull()
.references(() => documents.id, { onDelete: 'cascade' }),
userId: text('user_id')
.references(() => users.id, { onDelete: 'cascade' })
.notNull(),
visibility: text('visibility').default('private').notNull(), // 'private' | 'link'
pageViewCount: integer('page_view_count').default(0).notNull(),
...timestamps,
},
(t) => [
uniqueIndex('page_shares_document_id_unique').on(t.documentId),
index('page_shares_user_id_idx').on(t.userId),
],
);
export type NewPageShare = typeof pageShares.$inferInsert;
export type PageShareItem = typeof pageShares.$inferSelect;
@@ -16,6 +16,7 @@ import { documentHistories } from './documentHistory';
import { documents, files, knowledgeBases } from './file';
import { generationBatches, generations, generationTopics } from './generation';
import { messageGroups, messages, messagesFiles, messageTranslates } from './message';
import { pageShares } from './pageShare';
import { chunks, documentChunks, unstructuredChunks } from './rag';
import { sessionGroups, sessions } from './session';
import { threads, topicDocuments, topics } from './topic';
@@ -246,10 +247,22 @@ export const documentsRelations = relations(documents, ({ one, many }) => ({
relationName: 'fileDocuments',
}),
topics: many(topicDocuments),
shares: many(pageShares),
chunks: many(documentChunks),
histories: many(documentHistories),
}));
export const pageSharesRelations = relations(pageShares, ({ one }) => ({
document: one(documents, {
fields: [pageShares.documentId],
references: [documents.id],
}),
user: one(users, {
fields: [pageShares.userId],
references: [users.id],
}),
}));
export const documentHistoriesRelations = relations(documentHistories, ({ one }) => ({
document: one(documents, {
fields: [documentHistories.documentId],