Init supabase

This commit is contained in:
2025-02-08 15:24:20 -08:00
parent 674b3b45c3
commit 91411a6083
68 changed files with 7216 additions and 542 deletions
@@ -0,0 +1,28 @@
import { createClient } from '@/utils/supabase/server';
const tables = [
'days',
'hours',
'colors',
'categories',
'metrics',
'measurements'
];
export default async function UpdateUserIdsPage() {
const supabase = await createClient();
const USERID = '1240aecb-a352-482c-a49a-9b45e166691a';
for (const table of tables) {
const { data: schema } = await supabase.from(table).select();
for (const row of schema!) {
if (!row.userId) {
// Update userId in supabase
await supabase.from(table).update({ userId: USERID }).eq("id", schema!.id);
console.log(`Updated row: ${row.id} in table: ${table}`);
}
};
}
return <pre>Updated tables.</pre>
}
+6
View File
@@ -0,0 +1,6 @@
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}