Add cropping
This commit is contained in:
22
db/models.js
22
db/models.js
@@ -49,8 +49,25 @@ export const Job = sequelize.define('Job', {
|
||||
allowNull: false,
|
||||
defaultValue: 'qwen3.5:397b-cloud',
|
||||
},
|
||||
inputTokens: { type: DataTypes.INTEGER, allowNull: true },
|
||||
inputTokens: { type: DataTypes.INTEGER, allowNull: true },
|
||||
outputTokens: { type: DataTypes.INTEGER, allowNull: true },
|
||||
|
||||
// ---- Bounding-box detection fields (Pass 1) ----
|
||||
detectedSubject: {
|
||||
type: DataTypes.STRING(256),
|
||||
allowNull: true,
|
||||
comment: 'Short description of what the LLM identified as the subject',
|
||||
},
|
||||
bboxX: { type: DataTypes.FLOAT, allowNull: true },
|
||||
bboxY: { type: DataTypes.FLOAT, allowNull: true },
|
||||
bboxWidth: { type: DataTypes.FLOAT, allowNull: true },
|
||||
bboxHeight: { type: DataTypes.FLOAT, allowNull: true },
|
||||
|
||||
// Cropped image data URL (stored for UI preview / debugging)
|
||||
croppedImageDataUrl: {
|
||||
type: DataTypes.TEXT,
|
||||
allowNull: true,
|
||||
},
|
||||
}, {
|
||||
tableName: 'jobs',
|
||||
timestamps: true,
|
||||
@@ -59,5 +76,6 @@ export const Job = sequelize.define('Job', {
|
||||
export async function initDb() {
|
||||
const { mkdirSync } = await import('fs');
|
||||
mkdirSync(join(__dirname, '../data'), { recursive: true });
|
||||
await sequelize.sync();
|
||||
// alter: true adds new columns to an existing table without dropping data
|
||||
await sequelize.sync({ alter: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user