main page and group car
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import "dotenv/config";
|
||||
import { db } from ".";
|
||||
import { users } from "./schema";
|
||||
|
||||
const usersData = Array.from({ length: 10 }, (_, i) => ({
|
||||
id: `fake-user-${i + 1}`,
|
||||
name: `User ${i + 1}`,
|
||||
image: `https://github.com/mr-shortman.png`,
|
||||
}));
|
||||
|
||||
async function seed() {
|
||||
try {
|
||||
await db.insert(users).values(usersData);
|
||||
console.log(`Seeded users (${usersData.length})`);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
(() => {
|
||||
seed().then(() => {
|
||||
console.log("Seeding complete");
|
||||
process.exit(0);
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user