Added pgloader to vagrant install

This commit is contained in:
Josef Citrine 2016-07-17 21:34:40 +01:00
parent 7f2be0d6b6
commit c3ad562a8e
2 changed files with 6 additions and 4 deletions

View file

@ -18,15 +18,15 @@ class MysqlToPostgres extends Migration
$this->console = new ConsoleOutput();
// Generate pgloader config
$mysqlConnection = "from mysql://" . env('DB_USERNAME') . ":" . urlencode(env('DB_PASSWORD')) . "@" . env('DB_HOST') . "/" . env('DB_DATABASE');
$postgresConnection = "into postgresql://" . env('POSTGRESQL_DB_USERNAME', 'homestead') . ":" . urlencode(env('POSTGRESQL_DB_PASSWORD', 'secret')) . "@" . env('POSTGRESQL_DB_HOST', 'localhost') . "/" . env('POSTGRESQL_DB_DATABASE', 'homestead');
$mysqlConnection = "from mysql://" . env('DB_USERNAME') . ":" . env('DB_PASSWORD') . "@" . env('DB_HOST') . "/" . env('DB_DATABASE');
$postgresConnection = "into postgresql://" . env('POSTGRESQL_DB_USERNAME', 'homestead') . ":" . env('POSTGRESQL_DB_PASSWORD', 'secret') . "@" . env('POSTGRESQL_DB_HOST', 'localhost') . "/" . env('POSTGRESQL_DB_DATABASE', 'homestead');
$header = "LOAD DATABASE";
$body = <<<'EOD'
with truncate
CAST type datetime to timestamp drop default drop not null using zero-dates-to-null,
type date drop not null drop default using zero-dates-to-null
CAST type datetime to timestamp using zero-dates-to-null,
type date to timestamp using zero-dates-to-null
EXCLUDING TABLE NAMES MATCHING 'migrations';
EOD;

View file

@ -27,6 +27,8 @@ sudo apt-get -qq install -y AtomicParsley flac vorbis-tools imagemagick oracle-j
echo "Installing PHP extensions"
sudo apt-get -qq install -y libgmp-dev php-gmp
echo "Installing Postgres migration tool"
sudo apt-get -qq install -y pgloader
if type ffmpeg &>/dev/null; then
echo "ffmpeg is installed!"