diff --git a/prisma.config.ts b/prisma.config.ts new file mode 100644 index 0000000..52a7204 --- /dev/null +++ b/prisma.config.ts @@ -0,0 +1,14 @@ +// This file was generated by Prisma, and assumes you have installed the following: +// npm install --save-dev prisma dotenv +import "dotenv/config"; +import { defineConfig } from "prisma/config"; + +export default defineConfig({ + schema: "prisma/schema.prisma", + migrations: { + path: "prisma/migrations", + }, + datasource: { + url: "file:./prisma/dev.db", + }, +}); diff --git a/prisma/dev.db b/prisma/dev.db new file mode 100644 index 0000000..cce0442 Binary files /dev/null and b/prisma/dev.db differ diff --git a/prisma/migrations/20260514075455_init/migration.sql b/prisma/migrations/20260514075455_init/migration.sql new file mode 100644 index 0000000..cd6a15e --- /dev/null +++ b/prisma/migrations/20260514075455_init/migration.sql @@ -0,0 +1,11 @@ +-- CreateTable +CREATE TABLE "Stock" ( + "id" TEXT NOT NULL PRIMARY KEY, + "ticker" TEXT NOT NULL, + "notes" TEXT, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" DATETIME NOT NULL +); + +-- CreateIndex +CREATE UNIQUE INDEX "Stock_ticker_key" ON "Stock"("ticker"); diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml new file mode 100644 index 0000000..2a5a444 --- /dev/null +++ b/prisma/migrations/migration_lock.toml @@ -0,0 +1,3 @@ +# Please do not edit this file manually +# It should be added in your version-control system (e.g., Git) +provider = "sqlite" diff --git a/prisma/schema.prisma b/prisma/schema.prisma new file mode 100644 index 0000000..a50c553 --- /dev/null +++ b/prisma/schema.prisma @@ -0,0 +1,16 @@ +generator client { + provider = "prisma-client-js" + output = "../node_modules/.prisma/client" +} + +datasource db { + provider = "sqlite" +} + +model Stock { + id String @id @default(cuid()) + ticker String @unique + notes String? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt +}