Update lock files and cleanup
This commit is contained in:
12
db/models.js
12
db/models.js
@@ -20,10 +20,11 @@ export const Job = sequelize.define('Job', {
|
||||
type: DataTypes.TEXT,
|
||||
allowNull: false,
|
||||
},
|
||||
// Base64 data URL stored for replay; in production use object storage
|
||||
// Transient — holds the image only while the job is queued/running.
|
||||
// Nulled out once processing finishes so we don't persist user photos.
|
||||
imageDataUrl: {
|
||||
type: DataTypes.TEXT,
|
||||
allowNull: false,
|
||||
allowNull: true,
|
||||
},
|
||||
imageMimeType: {
|
||||
type: DataTypes.STRING(64),
|
||||
@@ -62,12 +63,6 @@ export const Job = sequelize.define('Job', {
|
||||
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,
|
||||
@@ -76,6 +71,5 @@ export const Job = sequelize.define('Job', {
|
||||
export async function initDb() {
|
||||
const { mkdirSync } = await import('fs');
|
||||
mkdirSync(join(__dirname, '../data'), { recursive: true });
|
||||
// alter: true adds new columns to an existing table without dropping data
|
||||
await sequelize.sync({ alter: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user