Goal-Calibration/data/seedDb.php

52 lines
888 B
PHP

<?php
$texts = [
[
'id' => 0,
'name' => 'Tanach',
],
];
$nodes = [
[
'id' => 0,
'title' => 'Tanach',
'textId' => 0,
'parentNodeId' => null,
],
[
'id' => 1,
'title' => 'Torah',
'textId' => 0,
'parentNodeId' => 0,
],
[
'id' => 2,
'title' => 'Bereishis',
'textId' => 0,
'parentNodeId' => 1,
],
];
$users = [
[
'id' => 0,
'email' => 'user@example.com',
],
];
$plans = [];
$scheduledNodes = [];
$fileDataMap = [
'texts.json' => $texts,
'nodes.json' => $nodes,
'users.json' => $users,
'plans.json' => $plans,
'scheduledNodes.json' => $scheduledNodes,
];
foreach ($fileDataMap as $file => $data) {
$path = __DIR__ . "/$file";
file_put_contents($path, json_encode($data, JSON_PRETTY_PRINT));
}