PHP Classes

File: migrate.php

Recommend this page to a friend!
  Classes of Ahmad Mustapha   Utility Web PHP API   migrate.php   Download  
File: migrate.php
Role: Application script
Content type: text/plain
Description: Application script
Class: Utility Web PHP API
API to retrieve movie details and other resources
Author: By
Last change:
Date: 3 years ago
Size: 506 bytes
 

Contents

Class file image Download
<?php

use App\Core\Database;
use
Dotenv\Dotenv;

require
'vendor/autoload.php';

//Load environment variables
$dotenv = Dotenv::createImmutable(__DIR__);
$dotenv->load();

//Helper functions
require('app/Core/Helpers/generalHelperFunctions.php');

$plainSQL = file_get_contents(root_path("storage/database/migrations.sql"));

$pdo = Database::create();

if(
$pdo->exec($plainSQL) !== false){
   
var_dump('Database table migrated successfully.');
}else{
   
var_dump('Database table migration failed: ');
}