apps/migration/src/old-db/schema/userPreferences.ts (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import { sql } from "drizzle-orm";
import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
export const userPreferences = sqliteTable("user_preferences", {
userId: text("user_id").primaryKey(),
uwuifyMessages: text("uwuify_messages", { enum: ["enabled", "disabled"] })
.default("disabled")
.notNull(),
});
export const uwuifyRateLimit = sqliteTable("uwuify_rate_limit", {
userId: text("user_id").primaryKey(),
count: integer("count").default(0).notNull(),
resetAt: integer("reset_at", { mode: "timestamp" }).notNull(),
});
export type UserPreference = typeof userPreferences.$inferSelect;
export type UwuifyRateLimit = typeof uwuifyRateLimit.$inferSelect;
|