-
-
Notifications
You must be signed in to change notification settings - Fork 731
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update schemas related to Unleash AI chat
- Loading branch information
Showing
5 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { FromSchema } from 'json-schema-to-ts'; | ||
|
||
export const aiChatNewMessageSchema = { | ||
$id: '#/components/schemas/aiChatNewMessageSchema', | ||
type: 'object', | ||
description: 'Describes a new Unleash AI chat message sent by the user.', | ||
required: ['message'], | ||
properties: { | ||
message: { | ||
type: 'string', | ||
description: 'The message content.', | ||
example: 'What is your purpose?', | ||
}, | ||
}, | ||
components: { | ||
schemas: {}, | ||
}, | ||
} as const; | ||
|
||
export type AIChatNewMessageSchema = FromSchema<typeof aiChatNewMessageSchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/migrations/20241016123833-ai-chats-rename-chat-col-to-messages.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
exports.up = function (db, cb) { | ||
db.runSql( | ||
` | ||
ALTER TABLE ai_chats RENAME COLUMN chat TO messages; | ||
`, | ||
cb, | ||
); | ||
}; | ||
|
||
exports.down = function (db, cb) { | ||
db.runSql( | ||
` | ||
ALTER TABLE ai_chats RENAME COLUMN messages TO chat; | ||
`, | ||
cb, | ||
); | ||
}; |