feat: add width, height, duration columns to attachments schema
This commit is contained in:
@@ -157,6 +157,14 @@ export function runMigrations(db: Database.Database): void {
|
|||||||
{ name: 'show_activity', type: 'INTEGER NOT NULL DEFAULT 1' },
|
{ name: 'show_activity', type: 'INTEGER NOT NULL DEFAULT 1' },
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'attachments',
|
||||||
|
columns: [
|
||||||
|
{ name: 'width', type: 'INTEGER' },
|
||||||
|
{ name: 'height', type: 'INTEGER' },
|
||||||
|
{ name: 'duration', type: 'REAL' },
|
||||||
|
]
|
||||||
|
},
|
||||||
// gif_api_key is handled by migrateRenameGifApiKey() — do NOT add it here
|
// gif_api_key is handled by migrateRenameGifApiKey() — do NOT add it here
|
||||||
// or it will race with the tenor_api_key → gif_api_key rename migration
|
// or it will race with the tenor_api_key → gif_api_key rename migration
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { sqliteTable, text, integer, primaryKey, foreignKey } from 'drizzle-orm/sqlite-core';
|
import { sqliteTable, text, integer, primaryKey, foreignKey, real } from 'drizzle-orm/sqlite-core';
|
||||||
|
|
||||||
export const users = sqliteTable('users', {
|
export const users = sqliteTable('users', {
|
||||||
id: text('id').primaryKey(),
|
id: text('id').primaryKey(),
|
||||||
@@ -90,6 +90,9 @@ export const attachments = sqliteTable('attachments', {
|
|||||||
mimetype: text('mimetype').notNull(),
|
mimetype: text('mimetype').notNull(),
|
||||||
size: integer('size').notNull(),
|
size: integer('size').notNull(),
|
||||||
thumbnailFilename: text('thumbnail_filename'),
|
thumbnailFilename: text('thumbnail_filename'),
|
||||||
|
width: integer('width'),
|
||||||
|
height: integer('height'),
|
||||||
|
duration: real('duration'),
|
||||||
createdAt: integer('created_at').notNull(),
|
createdAt: integer('created_at').notNull(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -217,6 +217,9 @@ export interface Attachment {
|
|||||||
mimetype: string;
|
mimetype: string;
|
||||||
size: number;
|
size: number;
|
||||||
thumbnailFilename?: string | null;
|
thumbnailFilename?: string | null;
|
||||||
|
width?: number | null;
|
||||||
|
height?: number | null;
|
||||||
|
duration?: number | null;
|
||||||
createdAt: number;
|
createdAt: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user