initial commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
-- CreateEnum
|
||||
CREATE TYPE "QuoteType" AS ENUM ('BLUE', 'BNA', 'BELO');
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "quotes" (
|
||||
"id" SERIAL NOT NULL,
|
||||
"timeStamp" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"buy" MONEY NOT NULL,
|
||||
"sell" MONEY NOT NULL,
|
||||
"type" "QuoteType" NOT NULL,
|
||||
"difference" DECIMAL(9,2) NOT NULL DEFAULT 0,
|
||||
"percentage" DECIMAL(9,2) NOT NULL DEFAULT 0,
|
||||
"previousDayDifference" DECIMAL(9,2) NOT NULL DEFAULT 0,
|
||||
"previousDayPercentage" DECIMAL(9,2) NOT NULL DEFAULT 0,
|
||||
|
||||
CONSTRAINT "quotes_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "quotes_history" (
|
||||
"id" SERIAL NOT NULL,
|
||||
"timeStamp" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"buy" MONEY NOT NULL,
|
||||
"sell" MONEY NOT NULL,
|
||||
"type" "QuoteType" NOT NULL,
|
||||
|
||||
CONSTRAINT "quotes_history_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
3
apps/backend/prisma/migrations/migration_lock.toml
Normal file
3
apps/backend/prisma/migrations/migration_lock.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
# Please do not edit this file manually
|
||||
# It should be added in your version-control system (e.g., Git)
|
||||
provider = "postgresql"
|
||||
44
apps/backend/prisma/schema.prisma
Normal file
44
apps/backend/prisma/schema.prisma
Normal file
@@ -0,0 +1,44 @@
|
||||
// This is your Prisma schema file,
|
||||
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
||||
|
||||
// Get a free hosted Postgres database in seconds: `npx create-db`
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client"
|
||||
output = "../src/generated/prisma"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
}
|
||||
|
||||
enum QuoteType {
|
||||
BLUE
|
||||
BNA
|
||||
BELO
|
||||
}
|
||||
|
||||
model Quote {
|
||||
id Int @id @default(autoincrement())
|
||||
timeStamp DateTime @default(now())
|
||||
buy Decimal @db.Money
|
||||
sell Decimal @db.Money
|
||||
type QuoteType
|
||||
difference Decimal @default(0) @db.Decimal(9, 2)
|
||||
percentage Decimal @default(0) @db.Decimal(9, 2)
|
||||
previousDayDifference Decimal @default(0) @db.Decimal(9, 2)
|
||||
previousDayPercentage Decimal @default(0) @db.Decimal(9, 2)
|
||||
|
||||
@@map("quotes")
|
||||
}
|
||||
|
||||
|
||||
model QuoteHistory {
|
||||
id Int @id @default(autoincrement())
|
||||
timeStamp DateTime @default(now())
|
||||
buy Decimal @db.Money
|
||||
sell Decimal @db.Money
|
||||
type QuoteType
|
||||
|
||||
@@map("quotes_history")
|
||||
}
|
||||
Reference in New Issue
Block a user