Add migrations and code for sharedAdventures table
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { pgTable,serial,text } from "drizzle-orm/pg-core";
|
||||
import { pgTable,json,text,serial } from "drizzle-orm/pg-core";
|
||||
|
||||
export const featuredAdventures = pgTable("featuredAdventures",{
|
||||
id:serial("id").primaryKey(),
|
||||
@@ -6,4 +6,7 @@ export const featuredAdventures = pgTable("featuredAdventures",{
|
||||
location:text("location"),
|
||||
})
|
||||
|
||||
|
||||
export const sharedAdventures = pgTable("sharedAdventures",{
|
||||
id:text("id").primaryKey(),
|
||||
data:json("data").notNull(),
|
||||
})
|
||||
@@ -1 +1,11 @@
|
||||
// place files you want to import through the `$lib` alias in this folder.
|
||||
export function generateRandomString() {
|
||||
let randomString = '';
|
||||
const digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
|
||||
for (let i = 0; i < 10; i++) {
|
||||
const randomIndex = Math.floor(Math.random() * digits.length);
|
||||
randomString += digits[randomIndex];
|
||||
}
|
||||
return randomString;
|
||||
}
|
||||
Reference in New Issue
Block a user