removed id_offer on trade

This commit is contained in:
Kevsl 2024-06-07 13:31:22 +02:00
parent 2db99d1354
commit 67d33dce2e
4 changed files with 11 additions and 13 deletions

View File

@ -0,0 +1,11 @@
/*
Warnings:
- You are about to drop the column `id_offer` on the `Trade` table. All the data in the column will be lost.
*/
-- DropForeignKey
ALTER TABLE "Trade" DROP CONSTRAINT "Trade_id_offer_fkey";
-- AlterTable
ALTER TABLE "Trade" DROP COLUMN "id_offer";

View File

@ -33,7 +33,6 @@ model Offer {
Crypto Crypto @relation(fields: [id_crypto], references: [id]) Crypto Crypto @relation(fields: [id_crypto], references: [id])
User User @relation(fields: [id_user], references: [id]) User User @relation(fields: [id_user], references: [id])
Trade Trade[]
} }
@ -61,11 +60,9 @@ model Trade {
id_receiver String id_receiver String
id_crypto String id_crypto String
amount_traded Float amount_traded Float
id_offer String
created_at DateTime @default(now()) created_at DateTime @default(now())
updated_at DateTime @updatedAt @default(now()) updated_at DateTime @updatedAt @default(now())
Offer Offer @relation(fields: [id_offer], references: [id])
Giver User @relation("Giver", fields: [id_giver], references: [id]) Giver User @relation("Giver", fields: [id_giver], references: [id])
Receiver User @relation("Receiver", fields: [id_receiver], references: [id]) Receiver User @relation("Receiver", fields: [id_receiver], references: [id])
Crypto Crypto @relation(fields: [id_crypto], references: [id]) Crypto Crypto @relation(fields: [id_crypto], references: [id])

View File

@ -1,9 +0,0 @@
import { IsInt, IsString } from 'class-validator';
export class PromoCodeDto {
@IsString()
name: string;
@IsInt()
value: number;
}

View File

@ -76,7 +76,6 @@ export class TradeService {
id_receiver: userId, id_receiver: userId,
id_crypto: offer.id_crypto, id_crypto: offer.id_crypto,
amount_traded: offer.amount, amount_traded: offer.amount,
id_offer: offer.id,
}, },
}); });