update choice for opinion
All checks were successful
backend-action / build-image (push) Successful in 42s
All checks were successful
backend-action / build-image (push) Successful in 42s
This commit is contained in:
@@ -69,8 +69,8 @@ export const groupRelation = relations(group, ({ many }) => ({
|
||||
export const opinion = sqliteTable("opinions", {
|
||||
id: integer("id", { mode: "number" }).primaryKey({ autoIncrement: true }),
|
||||
name: text("name").unique().notNull(),
|
||||
type: text("type", { enum: ["3Choice", "4Choice"] })
|
||||
.default("3Choice")
|
||||
type: text("type", { enum: ["3Choice", "4Choice", "5Choice"] })
|
||||
.default("5Choice")
|
||||
.notNull(),
|
||||
});
|
||||
|
||||
@@ -85,8 +85,15 @@ export const userOpinion = sqliteTable(
|
||||
.notNull()
|
||||
.references(() => opinion.id),
|
||||
choice: text("choice", {
|
||||
enum: ["agree", "disagree", "deciding", "ignore"],
|
||||
}).default("deciding"),
|
||||
enum: [
|
||||
"strongly agree",
|
||||
"agree",
|
||||
"disagree",
|
||||
"strongly disagree",
|
||||
"ignore",
|
||||
"deciding",
|
||||
],
|
||||
}).default("ignore"),
|
||||
},
|
||||
(t) => ({
|
||||
pk: primaryKey({ columns: [t.userId, t.opinionId] }),
|
||||
|
||||
@@ -143,6 +143,7 @@ async function getAllUserCount(
|
||||
.where(and(...conditions))
|
||||
.then((v) => v[0].count);
|
||||
}
|
||||
|
||||
async function getAllUser(
|
||||
offset: number,
|
||||
limit: number,
|
||||
|
||||
Reference in New Issue
Block a user