Browse Source

added migration file and db connection

main
Miteruzo 1 year ago
parent
commit
170e5d6de8
2 changed files with 11 additions and 0 deletions
  1. +1
    -0
      db_connection.php
  2. +10
    -0
      migrate.php

+ 1
- 0
db_connection.php View File

@@ -9,6 +9,7 @@ $db_pass = $config['pass'];

$__db_connection = new mysqli ($db_host, $db_user, $db_pass, 'goatoh_training',
$db_port);
$__db_connection -> set_charset ('utf8');

unset ($config);
unset ($db_host);


+ 10
- 0
migrate.php View File

@@ -0,0 +1,10 @@
<?php

require_once './db_connection.php';


$files = glob ('./migrations/*.sql');

foreach ($files as $file)
$__db_connection -> query (file_get_contents ($file));


Loading…
Cancel
Save