2097 lines
55 KiB
JavaScript
2097 lines
55 KiB
JavaScript
const db = require('../models');
|
|
const Users = db.users;
|
|
|
|
const CalendarEvents = db.calendar_events;
|
|
|
|
const Cases = db.cases;
|
|
|
|
const DonorsSuppliers = db.donors_suppliers;
|
|
|
|
const Injuries = db.injuries;
|
|
|
|
const MedicationReminders = db.medication_reminders;
|
|
|
|
const PermitsLicenses = db.permits_licenses;
|
|
|
|
const RehabilitationFacilities = db.rehabilitation_facilities;
|
|
|
|
const RescueReports = db.rescue_reports;
|
|
|
|
const Resources = db.resources;
|
|
|
|
const Species = db.species;
|
|
|
|
const TreatmentPlans = db.treatment_plans;
|
|
|
|
const TriageNotes = db.triage_notes;
|
|
|
|
const Volunteers = db.volunteers;
|
|
|
|
const Rehabilitationfacility = db.rehabilitationfacility;
|
|
|
|
const CalendarEventsData = [
|
|
{
|
|
type: 'release',
|
|
|
|
title: 'Ibuprofen dose',
|
|
|
|
date_time: new Date('2024-06-05T08:00:00Z'),
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
type: 'release',
|
|
|
|
title: 'Fracture check',
|
|
|
|
date_time: new Date('2024-06-06T10:00:00Z'),
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
type: 'triage',
|
|
|
|
title: 'IV fluids administration',
|
|
|
|
date_time: new Date('2024-06-07T09:00:00Z'),
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
type: 'triage',
|
|
|
|
title: 'Weight check',
|
|
|
|
date_time: new Date('2024-06-08T11:00:00Z'),
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
type: 'release',
|
|
|
|
title: 'Tortoise release planning',
|
|
|
|
date_time: new Date('2024-07-01T09:00:00Z'),
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
];
|
|
|
|
const CasesData = [
|
|
{
|
|
// type code here for "relation_one" field
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
intake_date: new Date('2024-06-01T00:00:00Z'),
|
|
|
|
condition: 'oil-soaked feathers',
|
|
|
|
status: 'underobservation',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
// type code here for "relation_one" field
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
intake_date: new Date('2024-06-03T00:00:00Z'),
|
|
|
|
condition: 'leg fracture',
|
|
|
|
status: 'released',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
// type code here for "relation_one" field
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
intake_date: new Date('2024-06-05T00:00:00Z'),
|
|
|
|
condition: 'dehydration',
|
|
|
|
status: 'intreatment',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
// type code here for "relation_one" field
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
intake_date: new Date('2024-06-07T00:00:00Z'),
|
|
|
|
condition: 'malnutrition',
|
|
|
|
status: 'released',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
// type code here for "relation_one" field
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
intake_date: new Date('2024-06-09T00:00:00Z'),
|
|
|
|
condition: 'shell damage',
|
|
|
|
status: 'released',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
];
|
|
|
|
const DonorsSuppliersData = [
|
|
{
|
|
name: 'Ocean Watch Foundation',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
name: 'VetPharma ZA',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
name: 'Wildlife Trust',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
name: 'Eco Supplies',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
name: "Nature's Care",
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
];
|
|
|
|
const InjuriesData = [
|
|
{
|
|
type: 'hypothermia',
|
|
|
|
details: 'feather oil removal required',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
type: 'compound fracture',
|
|
|
|
details: 'right hind leg',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
type: 'severe dehydration',
|
|
|
|
details: 'requires IV fluids',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
type: 'underweight',
|
|
|
|
details: 'requires nutritional support',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
type: 'cracked shell',
|
|
|
|
details: 'requires shell repair',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
];
|
|
|
|
const MedicationRemindersData = [
|
|
{
|
|
// type code here for "relation_one" field
|
|
|
|
next_dose: new Date('2024-06-05T08:00:00Z'),
|
|
|
|
reminder_type: 'email',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
// type code here for "relation_one" field
|
|
|
|
next_dose: new Date('2024-06-04T20:00:00Z'),
|
|
|
|
reminder_type: 'SMS',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
// type code here for "relation_one" field
|
|
|
|
next_dose: new Date('2024-06-06T10:00:00Z'),
|
|
|
|
reminder_type: 'SMS',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
// type code here for "relation_one" field
|
|
|
|
next_dose: new Date('2024-06-08T09:00:00Z'),
|
|
|
|
reminder_type: 'SMS',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
// type code here for "relation_one" field
|
|
|
|
next_dose: new Date('2024-06-10T07:00:00Z'),
|
|
|
|
reminder_type: 'email',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
];
|
|
|
|
const PermitsLicensesData = [
|
|
{
|
|
// type code here for "relation_one" field
|
|
|
|
type: 'wildlife handling permit',
|
|
|
|
region: 'WC',
|
|
|
|
issue_date: new Date('2023-01-01T00:00:00Z'),
|
|
|
|
expiry_date: new Date('2024-12-31T00:00:00Z'),
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
// type code here for "relation_one" field
|
|
|
|
type: 'transport permit',
|
|
|
|
region: 'KZN',
|
|
|
|
issue_date: new Date('2023-02-01T00:00:00Z'),
|
|
|
|
expiry_date: new Date('2024-11-30T00:00:00Z'),
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
// type code here for "relation_one" field
|
|
|
|
type: 'rehabilitation permit',
|
|
|
|
region: 'GP',
|
|
|
|
issue_date: new Date('2023-03-01T00:00:00Z'),
|
|
|
|
expiry_date: new Date('2024-10-31T00:00:00Z'),
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
// type code here for "relation_one" field
|
|
|
|
type: 'veterinary license',
|
|
|
|
region: 'GP',
|
|
|
|
issue_date: new Date('2023-04-01T00:00:00Z'),
|
|
|
|
expiry_date: new Date('2024-09-30T00:00:00Z'),
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
// type code here for "relation_one" field
|
|
|
|
type: 'conservation permit',
|
|
|
|
region: 'EC',
|
|
|
|
issue_date: new Date('2023-05-01T00:00:00Z'),
|
|
|
|
expiry_date: new Date('2024-08-31T00:00:00Z'),
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
];
|
|
|
|
const RehabilitationFacilitiesData = [
|
|
{
|
|
name: 'Cape Town Wildlife Rehab',
|
|
|
|
region: 'Western Cape',
|
|
|
|
contact_email: 'info@ctwildlife.org',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
name: 'Durban Wildlife Center',
|
|
|
|
region: 'KwaZulu-Natal',
|
|
|
|
contact_email: 'contact@durbanwildlife.org',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
name: 'Johannesburg Animal Rescue',
|
|
|
|
region: 'Gauteng',
|
|
|
|
contact_email: 'support@johannesburgrescue.org',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
name: 'Pretoria Wildlife Sanctuary',
|
|
|
|
region: 'Gauteng',
|
|
|
|
contact_email: 'info@pretoriawildlife.org',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
name: 'Port Elizabeth Animal Care',
|
|
|
|
region: 'Eastern Cape',
|
|
|
|
contact_email: 'help@peanimalcare.org',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
];
|
|
|
|
const RescueReportsData = [
|
|
{
|
|
reporter_name: 'Linda P.',
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
location: 'Clifton Beach',
|
|
|
|
report_date: new Date('2024-06-02T00:00:00Z'),
|
|
|
|
status: 'resolved',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
reporter_name: 'John D.',
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
location: 'Durban North',
|
|
|
|
report_date: new Date('2024-06-04T00:00:00Z'),
|
|
|
|
status: 'notified',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
reporter_name: 'Sarah T.',
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
location: 'Muizenberg',
|
|
|
|
report_date: new Date('2024-06-06T00:00:00Z'),
|
|
|
|
status: 'resolved',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
reporter_name: 'Michael B.',
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
location: 'Kruger Park',
|
|
|
|
report_date: new Date('2024-06-08T00:00:00Z'),
|
|
|
|
status: 'resolved',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
reporter_name: 'Emma W.',
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
location: 'Addo Park',
|
|
|
|
report_date: new Date('2024-06-10T00:00:00Z'),
|
|
|
|
status: 'inprogress',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
];
|
|
|
|
const ResourcesData = [
|
|
{
|
|
title: 'Penguin Care Guide',
|
|
|
|
type: 'Article',
|
|
|
|
url: 'https://ctwildlife.org/guides/penguin-care.pdf',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
title: 'Hyaena Rehabilitation Manual',
|
|
|
|
type: 'Article',
|
|
|
|
url: 'https://durbanwildlife.org/manuals/hyaena-rehab.pdf',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
title: 'Seal Rescue Procedures',
|
|
|
|
type: 'PDF',
|
|
|
|
url: 'https://johannesburgrescue.org/videos/seal-rescue.mp4',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
title: 'Elephant Nutrition Guide',
|
|
|
|
type: 'Video',
|
|
|
|
url: 'https://pretoriawildlife.org/articles/elephant-nutrition.html',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
title: 'Tortoise Shell Repair Techniques',
|
|
|
|
type: 'PDF',
|
|
|
|
url: 'https://peanimalcare.org/guides/tortoise-shell-repair.pdf',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
];
|
|
|
|
const SpeciesData = [
|
|
{
|
|
common_name: 'African Penguin',
|
|
|
|
scientific_name: 'Spheniscus demersus',
|
|
|
|
intake_form_template: 'standard seabird form',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
common_name: 'Brown Hyaena',
|
|
|
|
scientific_name: 'Parahyaena brunnea',
|
|
|
|
intake_form_template: 'mammal trauma form',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
common_name: 'Cape Fur Seal',
|
|
|
|
scientific_name: 'Arctocephalus pusillus',
|
|
|
|
intake_form_template: 'marine mammal form',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
common_name: 'African Elephant',
|
|
|
|
scientific_name: 'Loxodonta africana',
|
|
|
|
intake_form_template: 'large mammal form',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
common_name: 'Leopard Tortoise',
|
|
|
|
scientific_name: 'Stigmochelys pardalis',
|
|
|
|
intake_form_template: 'reptile form',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
];
|
|
|
|
const TreatmentPlansData = [
|
|
{
|
|
medication: 'Ibuprofen',
|
|
|
|
dosage: '10mg/kg q8h',
|
|
|
|
start_date: new Date('2024-06-01T00:00:00Z'),
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
medication: 'Amoxicillin',
|
|
|
|
dosage: '15mg/kg q12h',
|
|
|
|
start_date: new Date('2024-06-03T00:00:00Z'),
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
medication: "Lactated Ringer's Solution",
|
|
|
|
dosage: 'IV drip',
|
|
|
|
start_date: new Date('2024-06-05T00:00:00Z'),
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
medication: 'Nutritional Supplement',
|
|
|
|
dosage: 'as per diet plan',
|
|
|
|
start_date: new Date('2024-06-07T00:00:00Z'),
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
medication: 'Calcium Supplement',
|
|
|
|
dosage: 'daily',
|
|
|
|
start_date: new Date('2024-06-09T00:00:00Z'),
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
];
|
|
|
|
const TriageNotesData = [
|
|
{
|
|
date: new Date('2024-06-01T00:00:00Z'),
|
|
|
|
note: 'stable after warming, started fluids',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
date: new Date('2024-06-03T00:00:00Z'),
|
|
|
|
note: 'x-ray confirms fracture, pain meds prescribed',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
date: new Date('2024-06-05T00:00:00Z'),
|
|
|
|
note: 'administered IV fluids, monitoring hydration levels',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
date: new Date('2024-06-07T00:00:00Z'),
|
|
|
|
note: 'initiated feeding plan, monitoring weight gain',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
date: new Date('2024-06-09T00:00:00Z'),
|
|
|
|
note: 'applied shell repair, monitoring healing process',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
];
|
|
|
|
const VolunteersData = [
|
|
{
|
|
name: 'Mark Lee',
|
|
|
|
onboarding_date: new Date('2024-05-15T00:00:00Z'),
|
|
|
|
training_status: 'completed',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
name: 'Anna K.',
|
|
|
|
onboarding_date: new Date('2024-05-20T00:00:00Z'),
|
|
|
|
training_status: 'inprogress',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
name: 'Tom R.',
|
|
|
|
onboarding_date: new Date('2024-05-25T00:00:00Z'),
|
|
|
|
training_status: 'inprogress',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
name: 'Emily S.',
|
|
|
|
onboarding_date: new Date('2024-05-30T00:00:00Z'),
|
|
|
|
training_status: 'inprogress',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
|
|
{
|
|
name: 'Lucas B.',
|
|
|
|
onboarding_date: new Date('2024-06-01T00:00:00Z'),
|
|
|
|
training_status: 'inprogress',
|
|
|
|
// type code here for "relation_one" field
|
|
},
|
|
];
|
|
|
|
const RehabilitationfacilityData = [
|
|
{
|
|
name: 'Claude Bernard',
|
|
},
|
|
|
|
{
|
|
name: 'Christiaan Huygens',
|
|
},
|
|
|
|
{
|
|
name: 'Carl Gauss (Karl Friedrich Gauss)',
|
|
},
|
|
|
|
{
|
|
name: 'William Bayliss',
|
|
},
|
|
|
|
{
|
|
name: 'Albrecht von Haller',
|
|
},
|
|
];
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
async function associateUserWithRehabilitationfacility() {
|
|
const relatedRehabilitationfacility0 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const User0 = await Users.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (User0?.setRehabilitationfacility) {
|
|
await User0.setRehabilitationfacility(relatedRehabilitationfacility0);
|
|
}
|
|
|
|
const relatedRehabilitationfacility1 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const User1 = await Users.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (User1?.setRehabilitationfacility) {
|
|
await User1.setRehabilitationfacility(relatedRehabilitationfacility1);
|
|
}
|
|
|
|
const relatedRehabilitationfacility2 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const User2 = await Users.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (User2?.setRehabilitationfacility) {
|
|
await User2.setRehabilitationfacility(relatedRehabilitationfacility2);
|
|
}
|
|
|
|
const relatedRehabilitationfacility3 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const User3 = await Users.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (User3?.setRehabilitationfacility) {
|
|
await User3.setRehabilitationfacility(relatedRehabilitationfacility3);
|
|
}
|
|
|
|
const relatedRehabilitationfacility4 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const User4 = await Users.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (User4?.setRehabilitationfacility) {
|
|
await User4.setRehabilitationfacility(relatedRehabilitationfacility4);
|
|
}
|
|
}
|
|
|
|
async function associateCalendarEventWithAssigned_to() {
|
|
const relatedAssigned_to0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const CalendarEvent0 = await CalendarEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (CalendarEvent0?.setAssigned_to) {
|
|
await CalendarEvent0.setAssigned_to(relatedAssigned_to0);
|
|
}
|
|
|
|
const relatedAssigned_to1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const CalendarEvent1 = await CalendarEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (CalendarEvent1?.setAssigned_to) {
|
|
await CalendarEvent1.setAssigned_to(relatedAssigned_to1);
|
|
}
|
|
|
|
const relatedAssigned_to2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const CalendarEvent2 = await CalendarEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (CalendarEvent2?.setAssigned_to) {
|
|
await CalendarEvent2.setAssigned_to(relatedAssigned_to2);
|
|
}
|
|
|
|
const relatedAssigned_to3 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const CalendarEvent3 = await CalendarEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (CalendarEvent3?.setAssigned_to) {
|
|
await CalendarEvent3.setAssigned_to(relatedAssigned_to3);
|
|
}
|
|
|
|
const relatedAssigned_to4 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const CalendarEvent4 = await CalendarEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (CalendarEvent4?.setAssigned_to) {
|
|
await CalendarEvent4.setAssigned_to(relatedAssigned_to4);
|
|
}
|
|
}
|
|
|
|
async function associateCalendarEventWithRehabilitationfacility() {
|
|
const relatedRehabilitationfacility0 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const CalendarEvent0 = await CalendarEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (CalendarEvent0?.setRehabilitationfacility) {
|
|
await CalendarEvent0.setRehabilitationfacility(
|
|
relatedRehabilitationfacility0,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility1 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const CalendarEvent1 = await CalendarEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (CalendarEvent1?.setRehabilitationfacility) {
|
|
await CalendarEvent1.setRehabilitationfacility(
|
|
relatedRehabilitationfacility1,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility2 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const CalendarEvent2 = await CalendarEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (CalendarEvent2?.setRehabilitationfacility) {
|
|
await CalendarEvent2.setRehabilitationfacility(
|
|
relatedRehabilitationfacility2,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility3 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const CalendarEvent3 = await CalendarEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (CalendarEvent3?.setRehabilitationfacility) {
|
|
await CalendarEvent3.setRehabilitationfacility(
|
|
relatedRehabilitationfacility3,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility4 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const CalendarEvent4 = await CalendarEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (CalendarEvent4?.setRehabilitationfacility) {
|
|
await CalendarEvent4.setRehabilitationfacility(
|
|
relatedRehabilitationfacility4,
|
|
);
|
|
}
|
|
}
|
|
|
|
async function associateCaseWithFacility() {
|
|
const relatedFacility0 = await RehabilitationFacilities.findOne({
|
|
offset: Math.floor(
|
|
Math.random() * (await RehabilitationFacilities.count()),
|
|
),
|
|
});
|
|
const Case0 = await Cases.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (Case0?.setFacility) {
|
|
await Case0.setFacility(relatedFacility0);
|
|
}
|
|
|
|
const relatedFacility1 = await RehabilitationFacilities.findOne({
|
|
offset: Math.floor(
|
|
Math.random() * (await RehabilitationFacilities.count()),
|
|
),
|
|
});
|
|
const Case1 = await Cases.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (Case1?.setFacility) {
|
|
await Case1.setFacility(relatedFacility1);
|
|
}
|
|
|
|
const relatedFacility2 = await RehabilitationFacilities.findOne({
|
|
offset: Math.floor(
|
|
Math.random() * (await RehabilitationFacilities.count()),
|
|
),
|
|
});
|
|
const Case2 = await Cases.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (Case2?.setFacility) {
|
|
await Case2.setFacility(relatedFacility2);
|
|
}
|
|
|
|
const relatedFacility3 = await RehabilitationFacilities.findOne({
|
|
offset: Math.floor(
|
|
Math.random() * (await RehabilitationFacilities.count()),
|
|
),
|
|
});
|
|
const Case3 = await Cases.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (Case3?.setFacility) {
|
|
await Case3.setFacility(relatedFacility3);
|
|
}
|
|
|
|
const relatedFacility4 = await RehabilitationFacilities.findOne({
|
|
offset: Math.floor(
|
|
Math.random() * (await RehabilitationFacilities.count()),
|
|
),
|
|
});
|
|
const Case4 = await Cases.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (Case4?.setFacility) {
|
|
await Case4.setFacility(relatedFacility4);
|
|
}
|
|
}
|
|
|
|
async function associateCaseWithSpecies() {
|
|
const relatedSpecies0 = await Species.findOne({
|
|
offset: Math.floor(Math.random() * (await Species.count())),
|
|
});
|
|
const Case0 = await Cases.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (Case0?.setSpecies) {
|
|
await Case0.setSpecies(relatedSpecies0);
|
|
}
|
|
|
|
const relatedSpecies1 = await Species.findOne({
|
|
offset: Math.floor(Math.random() * (await Species.count())),
|
|
});
|
|
const Case1 = await Cases.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (Case1?.setSpecies) {
|
|
await Case1.setSpecies(relatedSpecies1);
|
|
}
|
|
|
|
const relatedSpecies2 = await Species.findOne({
|
|
offset: Math.floor(Math.random() * (await Species.count())),
|
|
});
|
|
const Case2 = await Cases.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (Case2?.setSpecies) {
|
|
await Case2.setSpecies(relatedSpecies2);
|
|
}
|
|
|
|
const relatedSpecies3 = await Species.findOne({
|
|
offset: Math.floor(Math.random() * (await Species.count())),
|
|
});
|
|
const Case3 = await Cases.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (Case3?.setSpecies) {
|
|
await Case3.setSpecies(relatedSpecies3);
|
|
}
|
|
|
|
const relatedSpecies4 = await Species.findOne({
|
|
offset: Math.floor(Math.random() * (await Species.count())),
|
|
});
|
|
const Case4 = await Cases.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (Case4?.setSpecies) {
|
|
await Case4.setSpecies(relatedSpecies4);
|
|
}
|
|
}
|
|
|
|
async function associateCaseWithRehabilitationfacility() {
|
|
const relatedRehabilitationfacility0 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Case0 = await Cases.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (Case0?.setRehabilitationfacility) {
|
|
await Case0.setRehabilitationfacility(relatedRehabilitationfacility0);
|
|
}
|
|
|
|
const relatedRehabilitationfacility1 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Case1 = await Cases.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (Case1?.setRehabilitationfacility) {
|
|
await Case1.setRehabilitationfacility(relatedRehabilitationfacility1);
|
|
}
|
|
|
|
const relatedRehabilitationfacility2 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Case2 = await Cases.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (Case2?.setRehabilitationfacility) {
|
|
await Case2.setRehabilitationfacility(relatedRehabilitationfacility2);
|
|
}
|
|
|
|
const relatedRehabilitationfacility3 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Case3 = await Cases.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (Case3?.setRehabilitationfacility) {
|
|
await Case3.setRehabilitationfacility(relatedRehabilitationfacility3);
|
|
}
|
|
|
|
const relatedRehabilitationfacility4 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Case4 = await Cases.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (Case4?.setRehabilitationfacility) {
|
|
await Case4.setRehabilitationfacility(relatedRehabilitationfacility4);
|
|
}
|
|
}
|
|
|
|
async function associateDonorsSupplierWithRehabilitationfacility() {
|
|
const relatedRehabilitationfacility0 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const DonorsSupplier0 = await DonorsSuppliers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (DonorsSupplier0?.setRehabilitationfacility) {
|
|
await DonorsSupplier0.setRehabilitationfacility(
|
|
relatedRehabilitationfacility0,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility1 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const DonorsSupplier1 = await DonorsSuppliers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (DonorsSupplier1?.setRehabilitationfacility) {
|
|
await DonorsSupplier1.setRehabilitationfacility(
|
|
relatedRehabilitationfacility1,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility2 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const DonorsSupplier2 = await DonorsSuppliers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (DonorsSupplier2?.setRehabilitationfacility) {
|
|
await DonorsSupplier2.setRehabilitationfacility(
|
|
relatedRehabilitationfacility2,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility3 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const DonorsSupplier3 = await DonorsSuppliers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (DonorsSupplier3?.setRehabilitationfacility) {
|
|
await DonorsSupplier3.setRehabilitationfacility(
|
|
relatedRehabilitationfacility3,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility4 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const DonorsSupplier4 = await DonorsSuppliers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (DonorsSupplier4?.setRehabilitationfacility) {
|
|
await DonorsSupplier4.setRehabilitationfacility(
|
|
relatedRehabilitationfacility4,
|
|
);
|
|
}
|
|
}
|
|
|
|
async function associateInjuryWithRehabilitationfacility() {
|
|
const relatedRehabilitationfacility0 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Injury0 = await Injuries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (Injury0?.setRehabilitationfacility) {
|
|
await Injury0.setRehabilitationfacility(relatedRehabilitationfacility0);
|
|
}
|
|
|
|
const relatedRehabilitationfacility1 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Injury1 = await Injuries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (Injury1?.setRehabilitationfacility) {
|
|
await Injury1.setRehabilitationfacility(relatedRehabilitationfacility1);
|
|
}
|
|
|
|
const relatedRehabilitationfacility2 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Injury2 = await Injuries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (Injury2?.setRehabilitationfacility) {
|
|
await Injury2.setRehabilitationfacility(relatedRehabilitationfacility2);
|
|
}
|
|
|
|
const relatedRehabilitationfacility3 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Injury3 = await Injuries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (Injury3?.setRehabilitationfacility) {
|
|
await Injury3.setRehabilitationfacility(relatedRehabilitationfacility3);
|
|
}
|
|
|
|
const relatedRehabilitationfacility4 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Injury4 = await Injuries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (Injury4?.setRehabilitationfacility) {
|
|
await Injury4.setRehabilitationfacility(relatedRehabilitationfacility4);
|
|
}
|
|
}
|
|
|
|
async function associateMedicationReminderWithTreatment_plan() {
|
|
const relatedTreatment_plan0 = await TreatmentPlans.findOne({
|
|
offset: Math.floor(Math.random() * (await TreatmentPlans.count())),
|
|
});
|
|
const MedicationReminder0 = await MedicationReminders.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (MedicationReminder0?.setTreatment_plan) {
|
|
await MedicationReminder0.setTreatment_plan(relatedTreatment_plan0);
|
|
}
|
|
|
|
const relatedTreatment_plan1 = await TreatmentPlans.findOne({
|
|
offset: Math.floor(Math.random() * (await TreatmentPlans.count())),
|
|
});
|
|
const MedicationReminder1 = await MedicationReminders.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (MedicationReminder1?.setTreatment_plan) {
|
|
await MedicationReminder1.setTreatment_plan(relatedTreatment_plan1);
|
|
}
|
|
|
|
const relatedTreatment_plan2 = await TreatmentPlans.findOne({
|
|
offset: Math.floor(Math.random() * (await TreatmentPlans.count())),
|
|
});
|
|
const MedicationReminder2 = await MedicationReminders.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (MedicationReminder2?.setTreatment_plan) {
|
|
await MedicationReminder2.setTreatment_plan(relatedTreatment_plan2);
|
|
}
|
|
|
|
const relatedTreatment_plan3 = await TreatmentPlans.findOne({
|
|
offset: Math.floor(Math.random() * (await TreatmentPlans.count())),
|
|
});
|
|
const MedicationReminder3 = await MedicationReminders.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (MedicationReminder3?.setTreatment_plan) {
|
|
await MedicationReminder3.setTreatment_plan(relatedTreatment_plan3);
|
|
}
|
|
|
|
const relatedTreatment_plan4 = await TreatmentPlans.findOne({
|
|
offset: Math.floor(Math.random() * (await TreatmentPlans.count())),
|
|
});
|
|
const MedicationReminder4 = await MedicationReminders.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (MedicationReminder4?.setTreatment_plan) {
|
|
await MedicationReminder4.setTreatment_plan(relatedTreatment_plan4);
|
|
}
|
|
}
|
|
|
|
async function associateMedicationReminderWithRehabilitationfacility() {
|
|
const relatedRehabilitationfacility0 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const MedicationReminder0 = await MedicationReminders.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (MedicationReminder0?.setRehabilitationfacility) {
|
|
await MedicationReminder0.setRehabilitationfacility(
|
|
relatedRehabilitationfacility0,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility1 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const MedicationReminder1 = await MedicationReminders.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (MedicationReminder1?.setRehabilitationfacility) {
|
|
await MedicationReminder1.setRehabilitationfacility(
|
|
relatedRehabilitationfacility1,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility2 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const MedicationReminder2 = await MedicationReminders.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (MedicationReminder2?.setRehabilitationfacility) {
|
|
await MedicationReminder2.setRehabilitationfacility(
|
|
relatedRehabilitationfacility2,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility3 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const MedicationReminder3 = await MedicationReminders.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (MedicationReminder3?.setRehabilitationfacility) {
|
|
await MedicationReminder3.setRehabilitationfacility(
|
|
relatedRehabilitationfacility3,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility4 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const MedicationReminder4 = await MedicationReminders.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (MedicationReminder4?.setRehabilitationfacility) {
|
|
await MedicationReminder4.setRehabilitationfacility(
|
|
relatedRehabilitationfacility4,
|
|
);
|
|
}
|
|
}
|
|
|
|
async function associatePermitsLicenseWithFacility() {
|
|
const relatedFacility0 = await RehabilitationFacilities.findOne({
|
|
offset: Math.floor(
|
|
Math.random() * (await RehabilitationFacilities.count()),
|
|
),
|
|
});
|
|
const PermitsLicense0 = await PermitsLicenses.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (PermitsLicense0?.setFacility) {
|
|
await PermitsLicense0.setFacility(relatedFacility0);
|
|
}
|
|
|
|
const relatedFacility1 = await RehabilitationFacilities.findOne({
|
|
offset: Math.floor(
|
|
Math.random() * (await RehabilitationFacilities.count()),
|
|
),
|
|
});
|
|
const PermitsLicense1 = await PermitsLicenses.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (PermitsLicense1?.setFacility) {
|
|
await PermitsLicense1.setFacility(relatedFacility1);
|
|
}
|
|
|
|
const relatedFacility2 = await RehabilitationFacilities.findOne({
|
|
offset: Math.floor(
|
|
Math.random() * (await RehabilitationFacilities.count()),
|
|
),
|
|
});
|
|
const PermitsLicense2 = await PermitsLicenses.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (PermitsLicense2?.setFacility) {
|
|
await PermitsLicense2.setFacility(relatedFacility2);
|
|
}
|
|
|
|
const relatedFacility3 = await RehabilitationFacilities.findOne({
|
|
offset: Math.floor(
|
|
Math.random() * (await RehabilitationFacilities.count()),
|
|
),
|
|
});
|
|
const PermitsLicense3 = await PermitsLicenses.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (PermitsLicense3?.setFacility) {
|
|
await PermitsLicense3.setFacility(relatedFacility3);
|
|
}
|
|
|
|
const relatedFacility4 = await RehabilitationFacilities.findOne({
|
|
offset: Math.floor(
|
|
Math.random() * (await RehabilitationFacilities.count()),
|
|
),
|
|
});
|
|
const PermitsLicense4 = await PermitsLicenses.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (PermitsLicense4?.setFacility) {
|
|
await PermitsLicense4.setFacility(relatedFacility4);
|
|
}
|
|
}
|
|
|
|
async function associatePermitsLicenseWithRehabilitationfacility() {
|
|
const relatedRehabilitationfacility0 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const PermitsLicense0 = await PermitsLicenses.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (PermitsLicense0?.setRehabilitationfacility) {
|
|
await PermitsLicense0.setRehabilitationfacility(
|
|
relatedRehabilitationfacility0,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility1 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const PermitsLicense1 = await PermitsLicenses.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (PermitsLicense1?.setRehabilitationfacility) {
|
|
await PermitsLicense1.setRehabilitationfacility(
|
|
relatedRehabilitationfacility1,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility2 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const PermitsLicense2 = await PermitsLicenses.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (PermitsLicense2?.setRehabilitationfacility) {
|
|
await PermitsLicense2.setRehabilitationfacility(
|
|
relatedRehabilitationfacility2,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility3 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const PermitsLicense3 = await PermitsLicenses.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (PermitsLicense3?.setRehabilitationfacility) {
|
|
await PermitsLicense3.setRehabilitationfacility(
|
|
relatedRehabilitationfacility3,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility4 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const PermitsLicense4 = await PermitsLicenses.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (PermitsLicense4?.setRehabilitationfacility) {
|
|
await PermitsLicense4.setRehabilitationfacility(
|
|
relatedRehabilitationfacility4,
|
|
);
|
|
}
|
|
}
|
|
|
|
async function associateRehabilitationFacilityWithRehabilitationfacility() {
|
|
const relatedRehabilitationfacility0 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const RehabilitationFacility0 = await RehabilitationFacilities.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (RehabilitationFacility0?.setRehabilitationfacility) {
|
|
await RehabilitationFacility0.setRehabilitationfacility(
|
|
relatedRehabilitationfacility0,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility1 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const RehabilitationFacility1 = await RehabilitationFacilities.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (RehabilitationFacility1?.setRehabilitationfacility) {
|
|
await RehabilitationFacility1.setRehabilitationfacility(
|
|
relatedRehabilitationfacility1,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility2 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const RehabilitationFacility2 = await RehabilitationFacilities.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (RehabilitationFacility2?.setRehabilitationfacility) {
|
|
await RehabilitationFacility2.setRehabilitationfacility(
|
|
relatedRehabilitationfacility2,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility3 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const RehabilitationFacility3 = await RehabilitationFacilities.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (RehabilitationFacility3?.setRehabilitationfacility) {
|
|
await RehabilitationFacility3.setRehabilitationfacility(
|
|
relatedRehabilitationfacility3,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility4 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const RehabilitationFacility4 = await RehabilitationFacilities.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (RehabilitationFacility4?.setRehabilitationfacility) {
|
|
await RehabilitationFacility4.setRehabilitationfacility(
|
|
relatedRehabilitationfacility4,
|
|
);
|
|
}
|
|
}
|
|
|
|
async function associateRescueReportWithSpecies() {
|
|
const relatedSpecies0 = await Species.findOne({
|
|
offset: Math.floor(Math.random() * (await Species.count())),
|
|
});
|
|
const RescueReport0 = await RescueReports.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (RescueReport0?.setSpecies) {
|
|
await RescueReport0.setSpecies(relatedSpecies0);
|
|
}
|
|
|
|
const relatedSpecies1 = await Species.findOne({
|
|
offset: Math.floor(Math.random() * (await Species.count())),
|
|
});
|
|
const RescueReport1 = await RescueReports.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (RescueReport1?.setSpecies) {
|
|
await RescueReport1.setSpecies(relatedSpecies1);
|
|
}
|
|
|
|
const relatedSpecies2 = await Species.findOne({
|
|
offset: Math.floor(Math.random() * (await Species.count())),
|
|
});
|
|
const RescueReport2 = await RescueReports.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (RescueReport2?.setSpecies) {
|
|
await RescueReport2.setSpecies(relatedSpecies2);
|
|
}
|
|
|
|
const relatedSpecies3 = await Species.findOne({
|
|
offset: Math.floor(Math.random() * (await Species.count())),
|
|
});
|
|
const RescueReport3 = await RescueReports.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (RescueReport3?.setSpecies) {
|
|
await RescueReport3.setSpecies(relatedSpecies3);
|
|
}
|
|
|
|
const relatedSpecies4 = await Species.findOne({
|
|
offset: Math.floor(Math.random() * (await Species.count())),
|
|
});
|
|
const RescueReport4 = await RescueReports.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (RescueReport4?.setSpecies) {
|
|
await RescueReport4.setSpecies(relatedSpecies4);
|
|
}
|
|
}
|
|
|
|
async function associateRescueReportWithRehabilitationfacility() {
|
|
const relatedRehabilitationfacility0 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const RescueReport0 = await RescueReports.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (RescueReport0?.setRehabilitationfacility) {
|
|
await RescueReport0.setRehabilitationfacility(
|
|
relatedRehabilitationfacility0,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility1 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const RescueReport1 = await RescueReports.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (RescueReport1?.setRehabilitationfacility) {
|
|
await RescueReport1.setRehabilitationfacility(
|
|
relatedRehabilitationfacility1,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility2 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const RescueReport2 = await RescueReports.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (RescueReport2?.setRehabilitationfacility) {
|
|
await RescueReport2.setRehabilitationfacility(
|
|
relatedRehabilitationfacility2,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility3 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const RescueReport3 = await RescueReports.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (RescueReport3?.setRehabilitationfacility) {
|
|
await RescueReport3.setRehabilitationfacility(
|
|
relatedRehabilitationfacility3,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility4 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const RescueReport4 = await RescueReports.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (RescueReport4?.setRehabilitationfacility) {
|
|
await RescueReport4.setRehabilitationfacility(
|
|
relatedRehabilitationfacility4,
|
|
);
|
|
}
|
|
}
|
|
|
|
async function associateResourceWithRehabilitationfacility() {
|
|
const relatedRehabilitationfacility0 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Resource0 = await Resources.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (Resource0?.setRehabilitationfacility) {
|
|
await Resource0.setRehabilitationfacility(relatedRehabilitationfacility0);
|
|
}
|
|
|
|
const relatedRehabilitationfacility1 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Resource1 = await Resources.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (Resource1?.setRehabilitationfacility) {
|
|
await Resource1.setRehabilitationfacility(relatedRehabilitationfacility1);
|
|
}
|
|
|
|
const relatedRehabilitationfacility2 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Resource2 = await Resources.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (Resource2?.setRehabilitationfacility) {
|
|
await Resource2.setRehabilitationfacility(relatedRehabilitationfacility2);
|
|
}
|
|
|
|
const relatedRehabilitationfacility3 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Resource3 = await Resources.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (Resource3?.setRehabilitationfacility) {
|
|
await Resource3.setRehabilitationfacility(relatedRehabilitationfacility3);
|
|
}
|
|
|
|
const relatedRehabilitationfacility4 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Resource4 = await Resources.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (Resource4?.setRehabilitationfacility) {
|
|
await Resource4.setRehabilitationfacility(relatedRehabilitationfacility4);
|
|
}
|
|
}
|
|
|
|
async function associateSpeciesWithRehabilitationfacility() {
|
|
const relatedRehabilitationfacility0 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Species0 = await Species.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (Species0?.setRehabilitationfacility) {
|
|
await Species0.setRehabilitationfacility(relatedRehabilitationfacility0);
|
|
}
|
|
|
|
const relatedRehabilitationfacility1 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Species1 = await Species.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (Species1?.setRehabilitationfacility) {
|
|
await Species1.setRehabilitationfacility(relatedRehabilitationfacility1);
|
|
}
|
|
|
|
const relatedRehabilitationfacility2 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Species2 = await Species.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (Species2?.setRehabilitationfacility) {
|
|
await Species2.setRehabilitationfacility(relatedRehabilitationfacility2);
|
|
}
|
|
|
|
const relatedRehabilitationfacility3 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Species3 = await Species.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (Species3?.setRehabilitationfacility) {
|
|
await Species3.setRehabilitationfacility(relatedRehabilitationfacility3);
|
|
}
|
|
|
|
const relatedRehabilitationfacility4 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Species4 = await Species.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (Species4?.setRehabilitationfacility) {
|
|
await Species4.setRehabilitationfacility(relatedRehabilitationfacility4);
|
|
}
|
|
}
|
|
|
|
async function associateTreatmentPlanWithRehabilitationfacility() {
|
|
const relatedRehabilitationfacility0 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const TreatmentPlan0 = await TreatmentPlans.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (TreatmentPlan0?.setRehabilitationfacility) {
|
|
await TreatmentPlan0.setRehabilitationfacility(
|
|
relatedRehabilitationfacility0,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility1 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const TreatmentPlan1 = await TreatmentPlans.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (TreatmentPlan1?.setRehabilitationfacility) {
|
|
await TreatmentPlan1.setRehabilitationfacility(
|
|
relatedRehabilitationfacility1,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility2 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const TreatmentPlan2 = await TreatmentPlans.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (TreatmentPlan2?.setRehabilitationfacility) {
|
|
await TreatmentPlan2.setRehabilitationfacility(
|
|
relatedRehabilitationfacility2,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility3 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const TreatmentPlan3 = await TreatmentPlans.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (TreatmentPlan3?.setRehabilitationfacility) {
|
|
await TreatmentPlan3.setRehabilitationfacility(
|
|
relatedRehabilitationfacility3,
|
|
);
|
|
}
|
|
|
|
const relatedRehabilitationfacility4 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const TreatmentPlan4 = await TreatmentPlans.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (TreatmentPlan4?.setRehabilitationfacility) {
|
|
await TreatmentPlan4.setRehabilitationfacility(
|
|
relatedRehabilitationfacility4,
|
|
);
|
|
}
|
|
}
|
|
|
|
async function associateTriageNoteWithRehabilitationfacility() {
|
|
const relatedRehabilitationfacility0 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const TriageNote0 = await TriageNotes.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (TriageNote0?.setRehabilitationfacility) {
|
|
await TriageNote0.setRehabilitationfacility(relatedRehabilitationfacility0);
|
|
}
|
|
|
|
const relatedRehabilitationfacility1 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const TriageNote1 = await TriageNotes.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (TriageNote1?.setRehabilitationfacility) {
|
|
await TriageNote1.setRehabilitationfacility(relatedRehabilitationfacility1);
|
|
}
|
|
|
|
const relatedRehabilitationfacility2 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const TriageNote2 = await TriageNotes.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (TriageNote2?.setRehabilitationfacility) {
|
|
await TriageNote2.setRehabilitationfacility(relatedRehabilitationfacility2);
|
|
}
|
|
|
|
const relatedRehabilitationfacility3 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const TriageNote3 = await TriageNotes.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (TriageNote3?.setRehabilitationfacility) {
|
|
await TriageNote3.setRehabilitationfacility(relatedRehabilitationfacility3);
|
|
}
|
|
|
|
const relatedRehabilitationfacility4 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const TriageNote4 = await TriageNotes.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (TriageNote4?.setRehabilitationfacility) {
|
|
await TriageNote4.setRehabilitationfacility(relatedRehabilitationfacility4);
|
|
}
|
|
}
|
|
|
|
async function associateVolunteerWithRehabilitationfacility() {
|
|
const relatedRehabilitationfacility0 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Volunteer0 = await Volunteers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0,
|
|
});
|
|
if (Volunteer0?.setRehabilitationfacility) {
|
|
await Volunteer0.setRehabilitationfacility(relatedRehabilitationfacility0);
|
|
}
|
|
|
|
const relatedRehabilitationfacility1 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Volunteer1 = await Volunteers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1,
|
|
});
|
|
if (Volunteer1?.setRehabilitationfacility) {
|
|
await Volunteer1.setRehabilitationfacility(relatedRehabilitationfacility1);
|
|
}
|
|
|
|
const relatedRehabilitationfacility2 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Volunteer2 = await Volunteers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2,
|
|
});
|
|
if (Volunteer2?.setRehabilitationfacility) {
|
|
await Volunteer2.setRehabilitationfacility(relatedRehabilitationfacility2);
|
|
}
|
|
|
|
const relatedRehabilitationfacility3 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Volunteer3 = await Volunteers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3,
|
|
});
|
|
if (Volunteer3?.setRehabilitationfacility) {
|
|
await Volunteer3.setRehabilitationfacility(relatedRehabilitationfacility3);
|
|
}
|
|
|
|
const relatedRehabilitationfacility4 = await Rehabilitationfacility.findOne({
|
|
offset: Math.floor(Math.random() * (await Rehabilitationfacility.count())),
|
|
});
|
|
const Volunteer4 = await Volunteers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 4,
|
|
});
|
|
if (Volunteer4?.setRehabilitationfacility) {
|
|
await Volunteer4.setRehabilitationfacility(relatedRehabilitationfacility4);
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
up: async (queryInterface, Sequelize) => {
|
|
await CalendarEvents.bulkCreate(CalendarEventsData);
|
|
|
|
await Cases.bulkCreate(CasesData);
|
|
|
|
await DonorsSuppliers.bulkCreate(DonorsSuppliersData);
|
|
|
|
await Injuries.bulkCreate(InjuriesData);
|
|
|
|
await MedicationReminders.bulkCreate(MedicationRemindersData);
|
|
|
|
await PermitsLicenses.bulkCreate(PermitsLicensesData);
|
|
|
|
await RehabilitationFacilities.bulkCreate(RehabilitationFacilitiesData);
|
|
|
|
await RescueReports.bulkCreate(RescueReportsData);
|
|
|
|
await Resources.bulkCreate(ResourcesData);
|
|
|
|
await Species.bulkCreate(SpeciesData);
|
|
|
|
await TreatmentPlans.bulkCreate(TreatmentPlansData);
|
|
|
|
await TriageNotes.bulkCreate(TriageNotesData);
|
|
|
|
await Volunteers.bulkCreate(VolunteersData);
|
|
|
|
await Rehabilitationfacility.bulkCreate(RehabilitationfacilityData);
|
|
|
|
await Promise.all([
|
|
// Similar logic for "relation_many"
|
|
|
|
await associateUserWithRehabilitationfacility(),
|
|
|
|
await associateCalendarEventWithAssigned_to(),
|
|
|
|
await associateCalendarEventWithRehabilitationfacility(),
|
|
|
|
await associateCaseWithFacility(),
|
|
|
|
await associateCaseWithSpecies(),
|
|
|
|
await associateCaseWithRehabilitationfacility(),
|
|
|
|
await associateDonorsSupplierWithRehabilitationfacility(),
|
|
|
|
await associateInjuryWithRehabilitationfacility(),
|
|
|
|
await associateMedicationReminderWithTreatment_plan(),
|
|
|
|
await associateMedicationReminderWithRehabilitationfacility(),
|
|
|
|
await associatePermitsLicenseWithFacility(),
|
|
|
|
await associatePermitsLicenseWithRehabilitationfacility(),
|
|
|
|
await associateRehabilitationFacilityWithRehabilitationfacility(),
|
|
|
|
await associateRescueReportWithSpecies(),
|
|
|
|
await associateRescueReportWithRehabilitationfacility(),
|
|
|
|
await associateResourceWithRehabilitationfacility(),
|
|
|
|
await associateSpeciesWithRehabilitationfacility(),
|
|
|
|
await associateTreatmentPlanWithRehabilitationfacility(),
|
|
|
|
await associateTriageNoteWithRehabilitationfacility(),
|
|
|
|
await associateVolunteerWithRehabilitationfacility(),
|
|
]);
|
|
},
|
|
|
|
down: async (queryInterface, Sequelize) => {
|
|
await queryInterface.bulkDelete('calendar_events', null, {});
|
|
|
|
await queryInterface.bulkDelete('cases', null, {});
|
|
|
|
await queryInterface.bulkDelete('donors_suppliers', null, {});
|
|
|
|
await queryInterface.bulkDelete('injuries', null, {});
|
|
|
|
await queryInterface.bulkDelete('medication_reminders', null, {});
|
|
|
|
await queryInterface.bulkDelete('permits_licenses', null, {});
|
|
|
|
await queryInterface.bulkDelete('rehabilitation_facilities', null, {});
|
|
|
|
await queryInterface.bulkDelete('rescue_reports', null, {});
|
|
|
|
await queryInterface.bulkDelete('resources', null, {});
|
|
|
|
await queryInterface.bulkDelete('species', null, {});
|
|
|
|
await queryInterface.bulkDelete('treatment_plans', null, {});
|
|
|
|
await queryInterface.bulkDelete('triage_notes', null, {});
|
|
|
|
await queryInterface.bulkDelete('volunteers', null, {});
|
|
|
|
await queryInterface.bulkDelete('rehabilitationfacility', null, {});
|
|
},
|
|
};
|