// Use DBML to define your database structure // Docs: https://dbml.dbdiagram.io/docs Table Users { user_id integer [primary key] username varchar email varchar phoneNumber varchar role varchar geoLocation POINT profilePicture VARCHAR created_at timestamp created_by integer } //table for farm details Table Farm { farm_id integer [primary key] user_id INT farmName VARCHAR(255) farmArea FLOAT numberOfSheds INT farmPicture VARCHAR(255) geoTag POINT createdAt TIMESTAMP } //the table will be filled in the batch entry Table Batch{ batch_id integer [primary key] batch_name varchar farm_id int weight_during_batch_entry double Number_of_chicks double DateOf_placement date currentAgeDays int createdAt TIMESTAMP } //this table will daily update the price of products Table ProductsPrice{ product_id int [primary key] chicks_price float(10,2) readyBird_price float(10,2) createdAt TIMESTAMP } //this table is for storing the training modules Table Training_modules{ training_module_id int [primary key] title varchar content TEXT video_path varchar image_path varchar createdAt TIMESTAMP } //reminder table to send reminders to user about important works Table Reminders{ reminder_id int [primary key] user_id int batch_id int TaskName varchar status ENUM createdAt TIMESTAMP } Table DailyActivitySchedule { activity_id int birdType VARCHAR ageInDays INT medicine VARCHAR vaccine VARCHAR feedType VARCHAR otherTasks VARCHAR createdAt TIMESTAMP } Table DailyActivityLog{ Log_id int batch_id int activity_id int isCompleted boolean completionDate date createdAt TIMESTAMP } //Table for check day/day the production things Table ProductionData{ production_id int farm_id int batch_id int date date feedConsumed float mortality int weightAverage int benchmarkDeviation enum createdAt TIMESTAMP } Table Consulations{ consulation_id int user_id int batch_id int farm_id int dateOfPlacement date sourceOfChicks varchar mortality int weight float treatmentDone text postMortemMedia JSON createdAt TIMESTAMP } //table for notification to send every farmOwner Table NotificationFromAdmin{ notification_id int image varchar title varchar content varchar isSent boolean createdAt timestamp } Ref:Users.user_id < Farm.user_id // one-to-many Ref:Farm.farm_id< Batch.farm_id Ref:Users.user_id< Reminders.user_id Ref:Batch.batch_id< Reminders.batch_id Ref:Batch.batch_id