// schema
export const usersTable = sqliteTable("users", {
id: text("id").primaryKey(),
username: text("username"),
// otros campos...
});
export const followsTable = sqliteTable(
"follows",
{
followerId: text("follower_id").references(() => usersTable.id),
followingId: text("following_id").references(() => usersTable.id),
createdAt: text("created_at").default(sql`(CURRENT_TIMESTAMP)`),
},
(followsTable) => ({
id: primaryKey([followsTable.followerId, followsTable.followingId]),
})
);
// schema
export const usersTable = sqliteTable("users", {
id: text("id").primaryKey(),
username: text("username"),
// otros campos...
});
export const followsTable = sqliteTable(
"follows",
{
followerId: text("follower_id").references(() => usersTable.id),
followingId: text("following_id").references(() => usersTable.id),
createdAt: text("created_at").default(sql`(CURRENT_TIMESTAMP)`),
},
(followsTable) => ({
id: primaryKey([followsTable.followerId, followsTable.followingId]),
})
);