mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-24 07:28:11 +02:00
Add media ordering to scheduled posts for better content presentation
Update schema to include `display_order` for post media and create a corresponding insert schema. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/561RCgs
This commit is contained in:
1 parent
a225842bd0
commit
0bdc1139d6
1 file changed
+6
@@ -79,6 +79,7 @@ export const postMedia = pgTable("post_media", {
|
|||||||
id: varchar("id").primaryKey().default(sql`gen_random_uuid()`),
|
id: varchar("id").primaryKey().default(sql`gen_random_uuid()`),
|
||||||
postId: varchar("post_id").notNull().references(() => posts.id, { onDelete: "cascade" }),
|
postId: varchar("post_id").notNull().references(() => posts.id, { onDelete: "cascade" }),
|
||||||
mediaId: varchar("media_id").notNull().references(() => media.id, { onDelete: "cascade" }),
|
mediaId: varchar("media_id").notNull().references(() => media.id, { onDelete: "cascade" }),
|
||||||
|
displayOrder: integer("display_order").notNull().default(0),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const scheduledPosts = pgTable("scheduled_posts", {
|
export const scheduledPosts = pgTable("scheduled_posts", {
|
||||||
@@ -260,6 +261,10 @@ export const insertUserPagePermissionSchema = createInsertSchema(userPagePermiss
|
|||||||
createdAt: true,
|
createdAt: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const insertPostMediaSchema = createInsertSchema(postMedia).omit({
|
||||||
|
id: true,
|
||||||
|
});
|
||||||
|
|
||||||
// Types
|
// Types
|
||||||
export type User = typeof users.$inferSelect;
|
export type User = typeof users.$inferSelect;
|
||||||
export type InsertUser = z.infer<typeof insertUserSchema>;
|
export type InsertUser = z.infer<typeof insertUserSchema>;
|
||||||
@@ -288,6 +293,7 @@ export type InsertOpenrouterConfig = z.infer<typeof insertOpenrouterConfigSchema
|
|||||||
export type UpdateOpenrouterConfig = z.infer<typeof updateOpenrouterConfigSchema>;
|
export type UpdateOpenrouterConfig = z.infer<typeof updateOpenrouterConfigSchema>;
|
||||||
|
|
||||||
export type PostMedia = typeof postMedia.$inferSelect;
|
export type PostMedia = typeof postMedia.$inferSelect;
|
||||||
|
export type InsertPostMedia = z.infer<typeof insertPostMediaSchema>;
|
||||||
|
|
||||||
export type UserPagePermission = typeof userPagePermissions.$inferSelect;
|
export type UserPagePermission = typeof userPagePermissions.$inferSelect;
|
||||||
export type InsertUserPagePermission = z.infer<typeof insertUserPagePermissionSchema>;
|
export type InsertUserPagePermission = z.infer<typeof insertUserPagePermissionSchema>;
|
||||||
Reference in new issue
Block a user