You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran php -f migrate.php init, answered some questions and at the last step ("Perform build of database...") I choosed Y.
I had no idea it would remove my table, thought it would only build the schema file and run migrations (since there is no migrations on the step, nothing would happen)
So maybe it's just me, but i think the script should mention that it's going to delete all tables.
Defaults are in brackets ([]). To accept the default, simply press ENTER.
Enter a name to use for the table that will hold your migration data [mpm_migrat
ions]:
Which method would you like to use to connect to
the database? 1=PDO or 2=MySQLi: 1
Enter your MySQL database hostname or IP address [localhost]:
Enter your MySQL database port [3306]:
Enter your MySQL database username: root
Enter your MySQL database password (enter - for no password) []:
Enter your MySQL database name: tests
Enter the directory where you'd like to store your
migration files [C:\Users\Kedo\gittest\mysql-php-migrations/db/]:
Perform build of database after initialization (builds schema
and runs all existing migrations) [y/N]: y
Configuration saved... looking for existing migrations table... not found.
Creating migrations table... done.
PHP Warning: Missing argument 1 for MpmBuildController::build(), called in C:\U
sers\Kedo\gittest\mysql-php-migrations\lib\controllers\init_controller.php on li
ne 351 and defined in C:\Users\Kedo\gittest\mysql-php-migrations\lib\controllers
\build_controller.php on line 154
Warning: Missing argument 1 for MpmBuildController::build(), called in C:\Users
Kedo\gittest\mysql-php-migrations\lib\controllers\init_controller.php on line 35
1 and defined in C:\Users\Kedo\gittest\mysql-php-migrations\lib\controllers\buil
d_controller.php on line 154
Looking for existing tables... found 1. Disabling foreign key restrictions... d
one.
Removing:
friends
Re-enabling foreign key restrictions... done.
Clearing out existing migration data... done.
Rebuilding migration data... done.
Building initial database schema... done.
Applying migrations... no migrations exist.PHP Notice: Undefined variable: with
_data in C:\Users\Kedo\gittest\mysql-php-migrations\lib\controllers\build_contro
ller.php on line 184
Notice: Undefined variable: with_data in C:\Users\Kedo\gittest\mysql-php-migrati
ons\lib\controllers\build_controller.php on line 184
Database build complete.
Initalization complete! Type 'php migrate.php help' for a list of commands.
The text was updated successfully, but these errors were encountered:
Yes, same here. At 1st I was thinking there is some bug with this tool, but if you would look at build_controller.php, you would see, it drops database at 1st:
public function build($with_data = false)
{
require_once(MPM_DB_PATH . 'schema.php');
$obj = new MpmInitialSchema();
$obj->destroy();
...
}
Maybe additional confirmation request from user would be the best here?
I ran php -f migrate.php init, answered some questions and at the last step ("Perform build of database...") I choosed Y.
I had no idea it would remove my table, thought it would only build the schema file and run migrations (since there is no migrations on the step, nothing would happen)
So maybe it's just me, but i think the script should mention that it's going to delete all tables.
P.S No valuable data were lost.
Log:
C:\Users\Kedo\gittest\mysql-php-migrations>php -f migrate.php init
MYSQL-PHP-MIGRATIONS
******************************************************************** v2.1.4 ***
Defaults are in brackets ([]). To accept the default, simply press ENTER.
Enter a name to use for the table that will hold your migration data [mpm_migrat
ions]:
Which method would you like to use to connect to
the database? 1=PDO or 2=MySQLi: 1
Enter your MySQL database hostname or IP address [localhost]:
Enter your MySQL database port [3306]:
Enter your MySQL database username: root
Enter your MySQL database password (enter - for no password) []:
Enter your MySQL database name: tests
Enter the directory where you'd like to store your
migration files [C:\Users\Kedo\gittest\mysql-php-migrations/db/]:
Perform build of database after initialization (builds schema
and runs all existing migrations) [y/N]: y
Configuration saved... looking for existing migrations table... not found.
Creating migrations table... done.
PHP Warning: Missing argument 1 for MpmBuildController::build(), called in C:\U
sers\Kedo\gittest\mysql-php-migrations\lib\controllers\init_controller.php on li
ne 351 and defined in C:\Users\Kedo\gittest\mysql-php-migrations\lib\controllers
\build_controller.php on line 154
Warning: Missing argument 1 for MpmBuildController::build(), called in C:\Users
Kedo\gittest\mysql-php-migrations\lib\controllers\init_controller.php on line 35
1 and defined in C:\Users\Kedo\gittest\mysql-php-migrations\lib\controllers\buil
d_controller.php on line 154
Looking for existing tables... found 1. Disabling foreign key restrictions... d
one.
Removing:
friends
Re-enabling foreign key restrictions... done.
Clearing out existing migration data... done.
Rebuilding migration data... done.
Building initial database schema... done.
Applying migrations... no migrations exist.PHP Notice: Undefined variable: with
_data in C:\Users\Kedo\gittest\mysql-php-migrations\lib\controllers\build_contro
ller.php on line 184
Notice: Undefined variable: with_data in C:\Users\Kedo\gittest\mysql-php-migrati
ons\lib\controllers\build_controller.php on line 184
Database build complete.
Initalization complete! Type 'php migrate.php help' for a list of commands.
The text was updated successfully, but these errors were encountered: