mirror of
https://github.com/Kevsl/crypto-exchange-api.git
synced 2026-02-08 02:56:13 +01:00
added crypto history
This commit is contained in:
13
prisma/migrations/20240607134613_/migration.sql
Normal file
13
prisma/migrations/20240607134613_/migration.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "CryptoHistory" (
|
||||
"id" TEXT NOT NULL,
|
||||
"id_crypto" TEXT NOT NULL,
|
||||
"value" DOUBLE PRECISION NOT NULL,
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "CryptoHistory_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "CryptoHistory" ADD CONSTRAINT "CryptoHistory_id_crypto_fkey" FOREIGN KEY ("id_crypto") REFERENCES "Crypto"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
@@ -19,8 +19,17 @@ model Crypto {
|
||||
UserHasCrypto UserHasCrypto[]
|
||||
Trade Trade[]
|
||||
Offer Offer[]
|
||||
CryptoHistory CryptoHistory[]
|
||||
}
|
||||
model CryptoHistory {
|
||||
id String @id @default(uuid())
|
||||
id_crypto String
|
||||
value Float
|
||||
created_at DateTime @default(now())
|
||||
updated_at DateTime @updatedAt @default(now())
|
||||
Crypto Crypto @relation(fields: [id_crypto], references: [id])
|
||||
|
||||
}
|
||||
|
||||
|
||||
model Offer {
|
||||
|
||||
Reference in New Issue
Block a user