add wipe db script
This commit is contained in:
parent
b80eaa2a9f
commit
0400282b03
2 changed files with 13 additions and 1 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"cy:open": "cypress open",
|
"cy:open": "cypress open",
|
||||||
"db:seed": "php storage/seedDb.php"
|
"db:seed": "php storage/seedDb.php",
|
||||||
|
"db:wipe": "php storage/wipeDb.php"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
11
storage/wipeDb.php
Normal file
11
storage/wipeDb.php
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$files = [
|
||||||
|
'users.json',
|
||||||
|
'carriers.json',
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($files as $file) {
|
||||||
|
$path = __DIR__."/$file";
|
||||||
|
file_put_contents($path, json_encode([], JSON_PRETTY_PRINT));
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue