添加 flowme 和 flowme-channel 路由,支持增删改查功能;更新 schema 以包含相关字段
This commit is contained in:
@@ -502,12 +502,35 @@ export const flowme = pgTable("flowme", {
|
||||
tags: jsonb().default([]),
|
||||
link: text('link').default(''),
|
||||
data: jsonb().default({}),
|
||||
|
||||
|
||||
channelId: uuid().references(() => flowmeChannels.id, { onDelete: 'set null' }),
|
||||
type: text('type').default(''),
|
||||
|
||||
source: text('source').default(''),
|
||||
importance: integer('importance').default(0), // 重要性等级
|
||||
isArchived: boolean('isArchived').default(false), // 是否归档
|
||||
|
||||
createdAt: timestamp('createdAt').notNull().defaultNow(),
|
||||
updatedAt: timestamp('updatedAt').notNull().defaultNow(),
|
||||
|
||||
}, (table) => [
|
||||
index('flowme_uid_idx').using('btree', table.uid.asc().nullsLast()),
|
||||
index('flowme_title_idx').using('btree', table.title.asc().nullsLast()),
|
||||
index('flowme_channel_id_idx').using('btree', table.channelId.asc().nullsLast()),
|
||||
]);
|
||||
|
||||
|
||||
export const flowmeChannels = pgTable("flowme_channels", {
|
||||
id: uuid().primaryKey().notNull().defaultRandom(),
|
||||
uid: uuid(),
|
||||
title: text('title').default(''),
|
||||
description: text('description').default(''),
|
||||
tags: jsonb().default([]),
|
||||
link: text('link').default(''),
|
||||
data: jsonb().default({}),
|
||||
color: text('color').default('#007bff'),
|
||||
createdAt: timestamp('createdAt').notNull().defaultNow(),
|
||||
updatedAt: timestamp('updatedAt').notNull().defaultNow(),
|
||||
}, (table) => [
|
||||
index('flowme_channels_uid_idx').using('btree', table.uid.asc().nullsLast()),
|
||||
index('flowme_channels_title_idx').using('btree', table.title.asc().nullsLast()),
|
||||
]);
|
||||
Reference in New Issue
Block a user