2650 lines
53 KiB
JavaScript
2650 lines
53 KiB
JavaScript
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const db = require('../models');
|
|
const Users = db.users;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Memorials = db.memorials;
|
|
|
|
const QrCodes = db.qr_codes;
|
|
|
|
const MediaItems = db.media_items;
|
|
|
|
const MediaCategories = db.media_categories;
|
|
|
|
const MediaItemCategories = db.media_item_categories;
|
|
|
|
const CondolenceMessages = db.condolence_messages;
|
|
|
|
const MemorialAccessRules = db.memorial_access_rules;
|
|
|
|
const AuditEvents = db.audit_events;
|
|
|
|
const SupportTickets = db.support_tickets;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const MemorialsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"full_name": "Antonio Herrera Ruiz",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"birth_date": new Date('1948-04-12T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"death_date": new Date('2021-09-03T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"biography": "Antonio was a dedicated teacher and a loving father. He enjoyed hiking, classical music, and community volunteering.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"visibility": "public",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"allow_condolences": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"public_slug": "antonio-herrera-ruiz",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"timezone": "Europe/Madrid",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"full_name": "Elena Gonzalez Soto",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"birth_date": new Date('1956-01-27T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"death_date": new Date('2020-11-18T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"biography": "Elena was known for her kindness and her passion for cooking for the whole family on Sundays.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"visibility": "unlisted",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"allow_condolences": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"public_slug": "elena-gonzalez-soto",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"timezone": "Europe/Madrid",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"full_name": "Rafael Herrera Molina",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"birth_date": new Date('1922-06-05T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"death_date": new Date('2009-02-14T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"biography": "Rafael served as a civil engineer and loved telling stories about the citys history.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"visibility": "unlisted",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"allow_condolences": false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"public_slug": "rafael-herrera-molina",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"timezone": "Europe/Madrid",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const QrCodesData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"target_url": "https://memorialqr.example.com/m/antonio-herrera-ruiz",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"code_value": "QR-ANTONIO-2021-0001",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"generated_at": new Date('2026-01-10T10:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"scan_count": 148,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"active": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"target_url": "https://memorialqr.example.com/m/elena-gonzalez-soto",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"code_value": "QR-ELENA-2020-0002",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"generated_at": new Date('2026-01-12T15:30:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"scan_count": 67,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"active": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"target_url": "https://memorialqr.example.com/m/rafael-herrera-molina",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"code_value": "QR-RAFAEL-2009-0003",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"generated_at": new Date('2026-01-20T09:05:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"scan_count": 12,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"active": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const MediaItemsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"title": "Family picnic photo",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "A sunny afternoon at the park with the whole family.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"media_type": "video",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"captured_at": new Date('2016-05-22T14:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"uploaded_at": new Date('2026-01-10T11:15:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sort_order": 1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"duration_seconds": 0,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"title": "Birthday toast video",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Short video from his 70th birthday celebration.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"media_type": "audio",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"captured_at": new Date('2018-04-12T20:30:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"uploaded_at": new Date('2026-01-10T11:22:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sort_order": 2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"duration_seconds": 52.5,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"title": "Sunday lunch audio",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "A voice note from a family lunch, full of laughter.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"media_type": "video",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"captured_at": new Date('2019-03-17T13:10:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"uploaded_at": new Date('2026-01-12T16:05:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sort_order": 1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"duration_seconds": 38.2,
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const MediaCategoriesData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"name": "Family",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Photos and videos with close family members.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sort_order": 1,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"name": "Hiking",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Outdoors and mountain trips.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sort_order": 2,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"name": "Cooking",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Recipes, kitchen moments, and celebrations.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sort_order": 1,
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const MediaItemCategoriesData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const CondolenceMessagesData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"author_name": "Mateo Gonzalez",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"author_email": "mateo.gonzalez@example.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"message": "Antonio will be remembered for his generosity and calm spirit. Our condolences to the family.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"posted_at": new Date('2026-01-11T09:30:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "rejected",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_public": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"author_name": "Laura Medina",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"author_email": "laura.medina@example.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"message": "Thank you for sharing these memories. Sending strength and peace.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"posted_at": new Date('2026-01-12T18:20:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "approved",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_public": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"author_name": "Valeria Torres",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"author_email": "valeria.torres@example.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"message": "Elena always made everyone feel welcome. With affection and respect.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"posted_at": new Date('2026-01-13T10:05:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "spam",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_public": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const MemorialAccessRulesData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"rule_type": "token",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"rule_value": "RafaelFamily2026",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"active": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"expires_at": new Date('2026-12-31T23:59:59Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"rule_type": "allow_domain",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"rule_value": "cousin.elena@example.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"active": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"expires_at": new Date('2026-06-30T23:59:59Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"rule_type": "password",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"rule_value": "gonzalezfamily.org",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"active": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"expires_at": new Date('2026-12-31T23:59:59Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const AuditEventsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"event_type": "logout",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"ip_address": "203.0.113.10",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"user_agent": "Mozilla/5.0 Windows NT 10.0 Chrome",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"occurred_at": new Date('2026-02-21T08:22:10Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"details": "User login successful",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"event_type": "memorial_created",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"ip_address": "203.0.113.11",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"user_agent": "Mozilla/5.0 Mac OS Safari",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"occurred_at": new Date('2026-01-10T10:05:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"details": "Created memorial and set visibility to public",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"event_type": "memorial_created",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"ip_address": "203.0.113.11",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"user_agent": "Mozilla/5.0 Mac OS Safari",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"occurred_at": new Date('2026-01-10T10:06:30Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"details": "Generated QR code QR-ANTONIO-2021-0001",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const SupportTicketsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"subject": "Cannot verify email",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "I did not receive the verification email after registration. Please resend it.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "closed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"priority": "urgent",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"opened_at": new Date('2026-02-10T11:20:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"closed_at": new Date('2026-02-10T11:20:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"subject": "QR download resolution request",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Is it possible to download the QR code in higher resolution for printing on a plaque.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "closed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"priority": "normal",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"opened_at": new Date('2026-01-15T09:10:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"closed_at": new Date('2026-01-15T09:10:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"subject": "Video upload failed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Uploading an MP4 larger than 200MB fails near the end. Please advise limits and recommendations.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "open",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"priority": "low",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"opened_at": new Date('2026-02-05T09:40:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"closed_at": new Date('2026-02-05T09:40:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateMemorialWithOwner() {
|
|
|
|
const relatedOwner0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Memorial0 = await Memorials.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Memorial0?.setOwner)
|
|
{
|
|
await
|
|
Memorial0.
|
|
setOwner(relatedOwner0);
|
|
}
|
|
|
|
const relatedOwner1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Memorial1 = await Memorials.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Memorial1?.setOwner)
|
|
{
|
|
await
|
|
Memorial1.
|
|
setOwner(relatedOwner1);
|
|
}
|
|
|
|
const relatedOwner2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Memorial2 = await Memorials.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Memorial2?.setOwner)
|
|
{
|
|
await
|
|
Memorial2.
|
|
setOwner(relatedOwner2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateQrCodeWithMemorial() {
|
|
|
|
const relatedMemorial0 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const QrCode0 = await QrCodes.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (QrCode0?.setMemorial)
|
|
{
|
|
await
|
|
QrCode0.
|
|
setMemorial(relatedMemorial0);
|
|
}
|
|
|
|
const relatedMemorial1 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const QrCode1 = await QrCodes.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (QrCode1?.setMemorial)
|
|
{
|
|
await
|
|
QrCode1.
|
|
setMemorial(relatedMemorial1);
|
|
}
|
|
|
|
const relatedMemorial2 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const QrCode2 = await QrCodes.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (QrCode2?.setMemorial)
|
|
{
|
|
await
|
|
QrCode2.
|
|
setMemorial(relatedMemorial2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateMediaItemWithMemorial() {
|
|
|
|
const relatedMemorial0 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const MediaItem0 = await MediaItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (MediaItem0?.setMemorial)
|
|
{
|
|
await
|
|
MediaItem0.
|
|
setMemorial(relatedMemorial0);
|
|
}
|
|
|
|
const relatedMemorial1 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const MediaItem1 = await MediaItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (MediaItem1?.setMemorial)
|
|
{
|
|
await
|
|
MediaItem1.
|
|
setMemorial(relatedMemorial1);
|
|
}
|
|
|
|
const relatedMemorial2 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const MediaItem2 = await MediaItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (MediaItem2?.setMemorial)
|
|
{
|
|
await
|
|
MediaItem2.
|
|
setMemorial(relatedMemorial2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateMediaItemWithUploaded_by() {
|
|
|
|
const relatedUploaded_by0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const MediaItem0 = await MediaItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (MediaItem0?.setUploaded_by)
|
|
{
|
|
await
|
|
MediaItem0.
|
|
setUploaded_by(relatedUploaded_by0);
|
|
}
|
|
|
|
const relatedUploaded_by1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const MediaItem1 = await MediaItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (MediaItem1?.setUploaded_by)
|
|
{
|
|
await
|
|
MediaItem1.
|
|
setUploaded_by(relatedUploaded_by1);
|
|
}
|
|
|
|
const relatedUploaded_by2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const MediaItem2 = await MediaItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (MediaItem2?.setUploaded_by)
|
|
{
|
|
await
|
|
MediaItem2.
|
|
setUploaded_by(relatedUploaded_by2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateMediaCategoryWithMemorial() {
|
|
|
|
const relatedMemorial0 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const MediaCategory0 = await MediaCategories.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (MediaCategory0?.setMemorial)
|
|
{
|
|
await
|
|
MediaCategory0.
|
|
setMemorial(relatedMemorial0);
|
|
}
|
|
|
|
const relatedMemorial1 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const MediaCategory1 = await MediaCategories.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (MediaCategory1?.setMemorial)
|
|
{
|
|
await
|
|
MediaCategory1.
|
|
setMemorial(relatedMemorial1);
|
|
}
|
|
|
|
const relatedMemorial2 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const MediaCategory2 = await MediaCategories.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (MediaCategory2?.setMemorial)
|
|
{
|
|
await
|
|
MediaCategory2.
|
|
setMemorial(relatedMemorial2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateMediaItemCategoryWithMedia_item() {
|
|
|
|
const relatedMedia_item0 = await MediaItems.findOne({
|
|
offset: Math.floor(Math.random() * (await MediaItems.count())),
|
|
});
|
|
const MediaItemCategory0 = await MediaItemCategories.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (MediaItemCategory0?.setMedia_item)
|
|
{
|
|
await
|
|
MediaItemCategory0.
|
|
setMedia_item(relatedMedia_item0);
|
|
}
|
|
|
|
const relatedMedia_item1 = await MediaItems.findOne({
|
|
offset: Math.floor(Math.random() * (await MediaItems.count())),
|
|
});
|
|
const MediaItemCategory1 = await MediaItemCategories.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (MediaItemCategory1?.setMedia_item)
|
|
{
|
|
await
|
|
MediaItemCategory1.
|
|
setMedia_item(relatedMedia_item1);
|
|
}
|
|
|
|
const relatedMedia_item2 = await MediaItems.findOne({
|
|
offset: Math.floor(Math.random() * (await MediaItems.count())),
|
|
});
|
|
const MediaItemCategory2 = await MediaItemCategories.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (MediaItemCategory2?.setMedia_item)
|
|
{
|
|
await
|
|
MediaItemCategory2.
|
|
setMedia_item(relatedMedia_item2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateMediaItemCategoryWithCategory() {
|
|
|
|
const relatedCategory0 = await MediaCategories.findOne({
|
|
offset: Math.floor(Math.random() * (await MediaCategories.count())),
|
|
});
|
|
const MediaItemCategory0 = await MediaItemCategories.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (MediaItemCategory0?.setCategory)
|
|
{
|
|
await
|
|
MediaItemCategory0.
|
|
setCategory(relatedCategory0);
|
|
}
|
|
|
|
const relatedCategory1 = await MediaCategories.findOne({
|
|
offset: Math.floor(Math.random() * (await MediaCategories.count())),
|
|
});
|
|
const MediaItemCategory1 = await MediaItemCategories.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (MediaItemCategory1?.setCategory)
|
|
{
|
|
await
|
|
MediaItemCategory1.
|
|
setCategory(relatedCategory1);
|
|
}
|
|
|
|
const relatedCategory2 = await MediaCategories.findOne({
|
|
offset: Math.floor(Math.random() * (await MediaCategories.count())),
|
|
});
|
|
const MediaItemCategory2 = await MediaItemCategories.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (MediaItemCategory2?.setCategory)
|
|
{
|
|
await
|
|
MediaItemCategory2.
|
|
setCategory(relatedCategory2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateCondolenceMessageWithMemorial() {
|
|
|
|
const relatedMemorial0 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const CondolenceMessage0 = await CondolenceMessages.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (CondolenceMessage0?.setMemorial)
|
|
{
|
|
await
|
|
CondolenceMessage0.
|
|
setMemorial(relatedMemorial0);
|
|
}
|
|
|
|
const relatedMemorial1 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const CondolenceMessage1 = await CondolenceMessages.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (CondolenceMessage1?.setMemorial)
|
|
{
|
|
await
|
|
CondolenceMessage1.
|
|
setMemorial(relatedMemorial1);
|
|
}
|
|
|
|
const relatedMemorial2 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const CondolenceMessage2 = await CondolenceMessages.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (CondolenceMessage2?.setMemorial)
|
|
{
|
|
await
|
|
CondolenceMessage2.
|
|
setMemorial(relatedMemorial2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateCondolenceMessageWithAuthor_user() {
|
|
|
|
const relatedAuthor_user0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const CondolenceMessage0 = await CondolenceMessages.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (CondolenceMessage0?.setAuthor_user)
|
|
{
|
|
await
|
|
CondolenceMessage0.
|
|
setAuthor_user(relatedAuthor_user0);
|
|
}
|
|
|
|
const relatedAuthor_user1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const CondolenceMessage1 = await CondolenceMessages.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (CondolenceMessage1?.setAuthor_user)
|
|
{
|
|
await
|
|
CondolenceMessage1.
|
|
setAuthor_user(relatedAuthor_user1);
|
|
}
|
|
|
|
const relatedAuthor_user2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const CondolenceMessage2 = await CondolenceMessages.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (CondolenceMessage2?.setAuthor_user)
|
|
{
|
|
await
|
|
CondolenceMessage2.
|
|
setAuthor_user(relatedAuthor_user2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateMemorialAccessRuleWithMemorial() {
|
|
|
|
const relatedMemorial0 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const MemorialAccessRule0 = await MemorialAccessRules.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (MemorialAccessRule0?.setMemorial)
|
|
{
|
|
await
|
|
MemorialAccessRule0.
|
|
setMemorial(relatedMemorial0);
|
|
}
|
|
|
|
const relatedMemorial1 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const MemorialAccessRule1 = await MemorialAccessRules.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (MemorialAccessRule1?.setMemorial)
|
|
{
|
|
await
|
|
MemorialAccessRule1.
|
|
setMemorial(relatedMemorial1);
|
|
}
|
|
|
|
const relatedMemorial2 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const MemorialAccessRule2 = await MemorialAccessRules.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (MemorialAccessRule2?.setMemorial)
|
|
{
|
|
await
|
|
MemorialAccessRule2.
|
|
setMemorial(relatedMemorial2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateAuditEventWithActor_user() {
|
|
|
|
const relatedActor_user0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const AuditEvent0 = await AuditEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (AuditEvent0?.setActor_user)
|
|
{
|
|
await
|
|
AuditEvent0.
|
|
setActor_user(relatedActor_user0);
|
|
}
|
|
|
|
const relatedActor_user1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const AuditEvent1 = await AuditEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (AuditEvent1?.setActor_user)
|
|
{
|
|
await
|
|
AuditEvent1.
|
|
setActor_user(relatedActor_user1);
|
|
}
|
|
|
|
const relatedActor_user2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const AuditEvent2 = await AuditEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (AuditEvent2?.setActor_user)
|
|
{
|
|
await
|
|
AuditEvent2.
|
|
setActor_user(relatedActor_user2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateAuditEventWithMemorial() {
|
|
|
|
const relatedMemorial0 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const AuditEvent0 = await AuditEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (AuditEvent0?.setMemorial)
|
|
{
|
|
await
|
|
AuditEvent0.
|
|
setMemorial(relatedMemorial0);
|
|
}
|
|
|
|
const relatedMemorial1 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const AuditEvent1 = await AuditEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (AuditEvent1?.setMemorial)
|
|
{
|
|
await
|
|
AuditEvent1.
|
|
setMemorial(relatedMemorial1);
|
|
}
|
|
|
|
const relatedMemorial2 = await Memorials.findOne({
|
|
offset: Math.floor(Math.random() * (await Memorials.count())),
|
|
});
|
|
const AuditEvent2 = await AuditEvents.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (AuditEvent2?.setMemorial)
|
|
{
|
|
await
|
|
AuditEvent2.
|
|
setMemorial(relatedMemorial2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateSupportTicketWithRequester() {
|
|
|
|
const relatedRequester0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const SupportTicket0 = await SupportTickets.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (SupportTicket0?.setRequester)
|
|
{
|
|
await
|
|
SupportTicket0.
|
|
setRequester(relatedRequester0);
|
|
}
|
|
|
|
const relatedRequester1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const SupportTicket1 = await SupportTickets.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (SupportTicket1?.setRequester)
|
|
{
|
|
await
|
|
SupportTicket1.
|
|
setRequester(relatedRequester1);
|
|
}
|
|
|
|
const relatedRequester2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const SupportTicket2 = await SupportTickets.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (SupportTicket2?.setRequester)
|
|
{
|
|
await
|
|
SupportTicket2.
|
|
setRequester(relatedRequester2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
up: async (queryInterface, Sequelize) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await Memorials.bulkCreate(MemorialsData);
|
|
|
|
|
|
|
|
|
|
await QrCodes.bulkCreate(QrCodesData);
|
|
|
|
|
|
|
|
|
|
await MediaItems.bulkCreate(MediaItemsData);
|
|
|
|
|
|
|
|
|
|
await MediaCategories.bulkCreate(MediaCategoriesData);
|
|
|
|
|
|
|
|
|
|
await MediaItemCategories.bulkCreate(MediaItemCategoriesData);
|
|
|
|
|
|
|
|
|
|
await CondolenceMessages.bulkCreate(CondolenceMessagesData);
|
|
|
|
|
|
|
|
|
|
await MemorialAccessRules.bulkCreate(MemorialAccessRulesData);
|
|
|
|
|
|
|
|
|
|
await AuditEvents.bulkCreate(AuditEventsData);
|
|
|
|
|
|
|
|
|
|
await SupportTickets.bulkCreate(SupportTicketsData);
|
|
|
|
|
|
await Promise.all([
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateMemorialWithOwner(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateQrCodeWithMemorial(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateMediaItemWithMemorial(),
|
|
|
|
|
|
|
|
|
|
await associateMediaItemWithUploaded_by(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateMediaCategoryWithMemorial(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateMediaItemCategoryWithMedia_item(),
|
|
|
|
|
|
|
|
|
|
await associateMediaItemCategoryWithCategory(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateCondolenceMessageWithMemorial(),
|
|
|
|
|
|
|
|
|
|
await associateCondolenceMessageWithAuthor_user(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateMemorialAccessRuleWithMemorial(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateAuditEventWithActor_user(),
|
|
|
|
|
|
|
|
|
|
await associateAuditEventWithMemorial(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateSupportTicketWithRequester(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
]);
|
|
|
|
},
|
|
|
|
down: async (queryInterface, Sequelize) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await queryInterface.bulkDelete('memorials', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('qr_codes', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('media_items', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('media_categories', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('media_item_categories', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('condolence_messages', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('memorial_access_rules', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('audit_events', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('support_tickets', null, {});
|
|
|
|
|
|
},
|
|
}; |