upd
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
PORT=3001
|
||||
DB_URL=postgres://postgres:v1sq3vD5faXL@194.26.138.94:5432/mate
|
||||
HMAC_SECRET=9a9ccda5db157ccfd04b4094264c55f58097f85d1fd6c22fbab0a86680dd3efd
|
||||
API_URL=http://localhost:3000
|
||||
API_URL=http://192.168.1.170:3000
|
||||
COMPANY_ID=2a4f54db-7a1f-42c2-a965-3b185d92b063
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import { pgTable, serial, text, timestamp, uuid } from "drizzle-orm/pg-core";
|
||||
import { usersTable } from "./users";
|
||||
import { sessionsTable } from "./sessions";
|
||||
import { relations } from "drizzle-orm";
|
||||
|
||||
export const commentsTable = pgTable("comments", {
|
||||
id: serial("id").primaryKey(),
|
||||
text: text("text").notNull(),
|
||||
createdAt: timestamp("created_at").notNull().defaultNow(),
|
||||
updatedAt: timestamp("updated_at").notNull().defaultNow(),
|
||||
ownerId: uuid("owner_id")
|
||||
.notNull()
|
||||
.references(() => usersTable.id),
|
||||
sessionId: uuid("session_id")
|
||||
.notNull()
|
||||
.references(() => sessionsTable.id),
|
||||
});
|
||||
|
||||
export const commentsRelations = relations(commentsTable, ({ one }) => ({
|
||||
owner: one(usersTable, {
|
||||
fields: [commentsTable.ownerId],
|
||||
references: [usersTable.id],
|
||||
}),
|
||||
session: one(sessionsTable, {
|
||||
fields: [commentsTable.sessionId],
|
||||
references: [sessionsTable.id],
|
||||
}),
|
||||
}));
|
||||
@@ -6,3 +6,4 @@ export * from "./sessions";
|
||||
export * from "./clients";
|
||||
export * from "./apps";
|
||||
export * from "./actions";
|
||||
export * from "./comments";
|
||||
|
||||
+2
-2
@@ -97,7 +97,7 @@ async function addApps() {
|
||||
})
|
||||
.json();
|
||||
} catch (error) {
|
||||
// console.error("Error adding apps", error);
|
||||
console.error("Error adding apps", error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ cron.schedule("*/5 * * * * *", scheduleSession);
|
||||
cron.schedule("*/10 * * * * *", updateStatus);
|
||||
|
||||
serve({
|
||||
port: 3001,
|
||||
port: process.env["PORT"],
|
||||
fetch: () => new Response("Hello World"),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user