Skip to content

Commit

Permalink
Added data_dump and _load commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
rdallasgray committed Dec 9, 2012
1 parent 5d67fb6 commit 8efd28b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bin/data_dump.php
@@ -0,0 +1,14 @@
<?php

require('init.php');

$u = Bbx_Config::get()->resources->db->params->username;
$p = Bbx_Config::get()->resources->db->params->password;
$d = Bbx_Config::get()->resources->db->params->dbname;
$path = APPLICATION_PATH . '/scripts/migrations';

$cmd = "mysqldump --user={$u} --password='{$p}' --add-drop-table --single-transaction --disable-keys --databases {$d} > {$path}/data.sql";

exec($cmd);

?>
14 changes: 14 additions & 0 deletions bin/data_load.php
@@ -0,0 +1,14 @@
<?php

require('init.php');

$u = Bbx_Config::get()->resources->db->params->username;
$p = Bbx_Config::get()->resources->db->params->password;
$d = Bbx_Config::get()->resources->db->params->dbname;
$path = APPLICATION_PATH . '/scripts/migrations';

$cmd = "mysql --user={$u} --password='{$p}' < {$path}/data.sql";

exec($cmd);

?>

0 comments on commit 8efd28b

Please sign in to comment.