diff --git a/prisma/migrations/20240607113031_/migration.sql b/prisma/migrations/20240607113031_/migration.sql new file mode 100644 index 0000000..9c4017f --- /dev/null +++ b/prisma/migrations/20240607113031_/migration.sql @@ -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"; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index ce0b3c2..4448e2a 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -33,7 +33,6 @@ model Offer { Crypto Crypto @relation(fields: [id_crypto], references: [id]) User User @relation(fields: [id_user], references: [id]) - Trade Trade[] } @@ -61,11 +60,9 @@ model Trade { id_receiver String id_crypto String amount_traded Float - id_offer String created_at DateTime @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]) Receiver User @relation("Receiver", fields: [id_receiver], references: [id]) Crypto Crypto @relation(fields: [id_crypto], references: [id]) diff --git a/src/trade/dto/promoCode.dto.ts b/src/trade/dto/promoCode.dto.ts deleted file mode 100644 index 8013811..0000000 --- a/src/trade/dto/promoCode.dto.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { IsInt, IsString } from 'class-validator'; - -export class PromoCodeDto { - @IsString() - name: string; - - @IsInt() - value: number; -} diff --git a/src/trade/trade.service.ts b/src/trade/trade.service.ts index 6b8fb1a..eb79761 100644 --- a/src/trade/trade.service.ts +++ b/src/trade/trade.service.ts @@ -76,7 +76,6 @@ export class TradeService { id_receiver: userId, id_crypto: offer.id_crypto, amount_traded: offer.amount, - id_offer: offer.id, }, });