@zodic/shared 0.0.17 → 0.0.19
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 +6 -3
- package/package.json +1 -1
package/db/schema.ts
CHANGED
|
@@ -33,6 +33,7 @@ export const users = sqliteTable(
|
|
|
33
33
|
createdAt: text('created_at')
|
|
34
34
|
.default(sql`CURRENT_TIMESTAMP`)
|
|
35
35
|
.notNull(),
|
|
36
|
+
updatedAt: text('updated_at').default(sql`CURRENT_TIMESTAMP`),
|
|
36
37
|
},
|
|
37
38
|
(t) => [index('users_email_idx').on(t.email)]
|
|
38
39
|
);
|
|
@@ -169,13 +170,12 @@ export const userConcepts = sqliteTable(
|
|
|
169
170
|
]
|
|
170
171
|
);
|
|
171
172
|
|
|
172
|
-
|
|
173
173
|
export const artifacts = sqliteTable(
|
|
174
174
|
'artifacts',
|
|
175
175
|
{
|
|
176
176
|
id: text('id').primaryKey(),
|
|
177
177
|
name: text('name').notNull(), // Name of the artifact (e.g., "Cosmic Mirror")
|
|
178
|
-
slug: text('slug').notNull(), // Slug of the artifact (e.g., "cosmic-mirror")
|
|
178
|
+
slug: text('slug').notNull().unique(), // Slug of the artifact (e.g., "cosmic-mirror")
|
|
179
179
|
conceptId: text('concept_id')
|
|
180
180
|
.notNull()
|
|
181
181
|
.references(() => concepts.id, { onDelete: 'cascade' }),
|
|
@@ -196,11 +196,14 @@ export const userArtifacts = sqliteTable(
|
|
|
196
196
|
userId: text('user_id')
|
|
197
197
|
.notNull()
|
|
198
198
|
.references(() => users.id, { onDelete: 'cascade' }),
|
|
199
|
+
userConceptId: text('user_concept_id')
|
|
200
|
+
.notNull()
|
|
201
|
+
.references(() => userConcepts.id, { onDelete: 'cascade' }),
|
|
199
202
|
artifactId: text('artifact_id')
|
|
200
203
|
.notNull()
|
|
201
204
|
.references(() => artifacts.id, { onDelete: 'cascade' }),
|
|
202
205
|
gender: text('gender').notNull(), // Gender of the user or chosen archetype
|
|
203
|
-
|
|
206
|
+
archetypeIndex: text('archetype_index').notNull(), // Chosen archetype for the artifact
|
|
204
207
|
postImageId: text('post_image_id'), // URL for the Instagram post image
|
|
205
208
|
reelImageId: text('reel_image_id'), // URL for the Instagram reels/TikTok image
|
|
206
209
|
postImageUrl: text('post_image_url'), // URL for the Instagram post image
|