mirror of
https://github.com/dylanbenzi/yellowbird.git
synced 2026-11-27 01:07:01 +00:00
db updates
This commit is contained in:
@@ -2,6 +2,7 @@ import { drizzle } from "drizzle-orm/postgres-js";
|
||||
import postgres from "postgres";
|
||||
import * as schema from "./schema";
|
||||
import "dotenv/config";
|
||||
import { sql } from "drizzle-orm";
|
||||
|
||||
// const connectionString = process.env.DATABASE_URL as string;
|
||||
const connectionString =
|
||||
|
||||
+19
-7
@@ -1,6 +1,7 @@
|
||||
import { pgEnum, pgTable, timestamp, uuid, varchar } from "drizzle-orm/pg-core";
|
||||
import { pgEnum, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
|
||||
import { sql } from "drizzle-orm";
|
||||
|
||||
export const DateTable = pgTable("date", {
|
||||
export const DateTable = pgTable("dates", {
|
||||
date: timestamp("date", { withTimezone: true })
|
||||
.unique()
|
||||
.notNull()
|
||||
@@ -16,10 +17,10 @@ export const EventVariant = pgEnum("eventVariant", [
|
||||
"default",
|
||||
]);
|
||||
|
||||
export const EventTable = pgTable("event", {
|
||||
export const EventsTable = pgTable("events", {
|
||||
id: uuid("eventId").primaryKey().defaultRandom(),
|
||||
title: varchar("title", { length: 255 }).notNull(),
|
||||
companyName: varchar("companyName", { length: 128 })
|
||||
title: text("title").notNull(),
|
||||
companyName: text("companyName")
|
||||
.notNull()
|
||||
.unique()
|
||||
.references(() => SymbolsTable.symbol),
|
||||
@@ -31,6 +32,17 @@ export const EventTable = pgTable("event", {
|
||||
});
|
||||
|
||||
export const SymbolsTable = pgTable("symbols", {
|
||||
symbol: varchar("symbol", { length: 16 }).notNull().primaryKey().unique(),
|
||||
companyName: varchar("companyName", { length: 128 }).notNull().unique(),
|
||||
symbol: text("symbol").notNull().primaryKey().unique(),
|
||||
companyName: text("companyName").notNull().unique(),
|
||||
});
|
||||
|
||||
// export const ThemeMode = pgEnum("themeMode", ["light", "dark", "system"]);
|
||||
|
||||
// export const UserPreferencesTable = pgTable("userPreferences", {
|
||||
// // userId: text("userId").primaryKey().notNull().unique().references(() => U),
|
||||
// theme: ThemeMode("theme").default("dark").notNull(),
|
||||
// });
|
||||
|
||||
// export const UsersTable = pgTable("users", {
|
||||
// userId: text("userId"),
|
||||
// });
|
||||
|
||||
Reference in New Issue
Block a user