@zodic/shared 0.0.322 → 0.0.323
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/db/schema.ts
CHANGED
|
@@ -383,21 +383,18 @@ export const userArtifacts = sqliteTable(
|
|
|
383
383
|
userConceptId: text('user_concept_id')
|
|
384
384
|
.notNull()
|
|
385
385
|
.references(() => userConcepts.id, { onDelete: 'cascade' }),
|
|
386
|
+
conceptId: text('concept_id')
|
|
387
|
+
.notNull()
|
|
388
|
+
.references(() => concepts.id, { onDelete: 'cascade' }), // New: Direct reference to concepts table
|
|
386
389
|
artifactId: text('artifact_id')
|
|
387
390
|
.notNull()
|
|
388
391
|
.references(() => artifacts.id, { onDelete: 'cascade' }),
|
|
389
|
-
gender: text('gender').notNull(), // Gender of the user or chosen archetype
|
|
390
|
-
archetypeIndex: text('archetype_index').notNull(), // Chosen archetype for the artifact
|
|
391
392
|
archetypeDataId: text('archetype_data_id').references(
|
|
392
393
|
() => archetypesData.id,
|
|
393
394
|
{ onDelete: 'cascade' }
|
|
394
|
-
), //
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
postImageUrl: text('post_image_url'), // URL for the Instagram post image
|
|
398
|
-
reelImageUrl: text('reel_image_url'), // URL for the Instagram reels/TikTok image
|
|
399
|
-
postGenerationId: text('post_generation_id'), // Leonardo's generation ID for the post image
|
|
400
|
-
reelGenerationId: text('reel_generation_id'), // Leonardo's generation ID for the reel image
|
|
395
|
+
), // References archetypesData.id, nullable
|
|
396
|
+
postImages: text('post_images'), // Stringified JSON array of { id: string, url: string } for up to 6 post images
|
|
397
|
+
reelImages: text('reel_images'), // Stringified JSON array of { id: string, url: string } for up to 6 reel images (if used)
|
|
401
398
|
status: text('status')
|
|
402
399
|
.default('pending') // Possible statuses: 'pending', 'post_ready', 'reel_ready', 'completed'
|
|
403
400
|
.notNull(),
|
|
@@ -408,6 +405,7 @@ export const userArtifacts = sqliteTable(
|
|
|
408
405
|
index('user_artifacts_artifact_id_idx').on(t.artifactId),
|
|
409
406
|
index('user_artifacts_status_idx').on(t.status),
|
|
410
407
|
index('user_artifacts_archetype_data_id_idx').on(t.archetypeDataId),
|
|
408
|
+
index('user_artifacts_concept_id_idx').on(t.conceptId), // New index for conceptId
|
|
411
409
|
]
|
|
412
410
|
);
|
|
413
411
|
|