From df23fd02038b67d75d8e6a0668c5aa2abd7b809a Mon Sep 17 00:00:00 2001
From: elit04 <elit04@fu-berlin.de>
Date: Thu, 13 Jan 2022 09:07:11 -0500
Subject: [PATCH] delete 'active' attribute from Boat table (status = active)

---
 server/src/controllers/boatControllers.controllers.ts | 3 ---
 server/src/db/models/Boat.ts                          | 6 ------
 server/src/routes/boatRoutes.routes.ts                | 1 -
 3 files changed, 10 deletions(-)

diff --git a/server/src/controllers/boatControllers.controllers.ts b/server/src/controllers/boatControllers.controllers.ts
index 3c5211f..fa1717c 100644
--- a/server/src/controllers/boatControllers.controllers.ts
+++ b/server/src/controllers/boatControllers.controllers.ts
@@ -29,7 +29,6 @@ const createBoat = async (req: Request, res: Response) => {
           name: newBoat.name,
           boatTypeId: newBoat.boattype,
           status: newBoat.status,
-          active: newBoat.active,
           tags: newBoat.tags,
         },
       });
@@ -52,7 +51,6 @@ const showAllBoatsController = async (req: Request, res: Response) => {
           name: boat.name,
           boatType: boat.boattype,
           status: boat.status,
-          active: boat.active,
           tags: boat.tags,
         };
       }),
@@ -75,7 +73,6 @@ const showBoatById = async (req: Request, res: Response) => {
           name: boat.name,
           boatTypeId: boat.boattype,
           status: boat.status,
-          active: boat.active,
           tags: boat.tags,
         },
       });
diff --git a/server/src/db/models/Boat.ts b/server/src/db/models/Boat.ts
index e1f07b5..9b5aa0b 100644
--- a/server/src/db/models/Boat.ts
+++ b/server/src/db/models/Boat.ts
@@ -6,7 +6,6 @@ interface BoatAttributes {
   name: string;
   boattype: string;
   status: boolean;
-  active: boolean;
   tags: Array<string>;
 }
 
@@ -17,7 +16,6 @@ class Boat extends Model<BoatAttributes, BoatTypeInput> implements BoatAttribute
   declare name: string;
   declare boattype: string;
   declare status: boolean;
-  declare active: boolean;
   declare tags: Array<string>;
 
   declare readonly createdAt: Date;
@@ -49,10 +47,6 @@ export const initBoat = async (sequelizeConnection: Sequelize) => {
       type: DataTypes.BOOLEAN,
       allowNull: false,
     },
-    active: {
-      type: DataTypes.BOOLEAN,
-      allowNull: false,
-    },
     tags: {
       type: new DataTypes.ARRAY(DataTypes.STRING),
     }
diff --git a/server/src/routes/boatRoutes.routes.ts b/server/src/routes/boatRoutes.routes.ts
index c94ca48..3536a6c 100644
--- a/server/src/routes/boatRoutes.routes.ts
+++ b/server/src/routes/boatRoutes.routes.ts
@@ -27,7 +27,6 @@ boatsRouter.post(
   body("name").not().isEmpty(),
   body("boattype").not().isEmpty(),
   body("status").not().isEmpty() && body("status").isIn([1,0]),
-  body("active").not().isEmpty() && body("active").isIn([1,0]),
   body("tags").not().isEmpty(),
   handleValidationResult,
   validateToken,
-- 
GitLab