webvimark / user-management

154 stars 163 forks source link

migration failed... #206

Open rizrob66 opened 5 years ago

rizrob66 commented 5 years ago

Hello, when I do migrate this error appear:

m141207_001649_create_basic_user_permissions

Apply the above migrations? (yes|no) [no]:yes *** applying m140608_173539_create_user_table

create table ...Exception: SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' The SQL being executed was: CREATE TABLE ` ( id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,

Could you help me?

Dezyderyjczyk commented 5 years ago

My database is empty

/new> ./yii migrate --migrationPath=vendor/webvimark/module-user-management/migrations/ Yii Migration Tool (based on Yii v2.0.22)

Total 10 new migrations to be applied: m140608_173539_create_user_table m140611_133903_init_rbac m140808_073114_create_auth_item_group_table m140809_072112_insert_superadmin_to_user m140809_073114_insert_common_permisison_to_auth_item m141023_141535_create_user_visit_log m141116_115804_add_bind_to_ip_and_registration_ip_to_user m141121_194858_split_browser_and_os_column m141201_220516_add_email_and_email_confirmed_to_user m141207_001649_create_basic_user_permissions

Apply the above migrations? (yes|no) [no]:yes *** applying m140608_173539_create_user_table Exception: Trying to get property 'user_table' of non-object (/new/vendor/webvimark/module-user-management/migrations/m140608_173539_create_user_table.php:18)

0 /new/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(725): m140608_173539_create_user_table->up()

1 /new/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(199): yii\console\controllers\MigrateController->migrateUp()

2 /new/vendor/yiisoft/yii2/base/InlineAction.php(57): yii\console\controllers\MigrateController->actionUp()

3 /new/vendor/yiisoft/yii2/base/InlineAction.php(57): ::call_user_func_array:{/new/vendor/yiisoft/yii2/base/InlineAction.php:57}()

4 /new/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams()

5 /new/vendor/yiisoft/yii2/console/Controller.php(148): yii\console\controllers\MigrateController->runAction()

6 /new/vendor/yiisoft/yii2/base/Module.php(528): yii\console\controllers\MigrateController->runAction()

7 /new/vendor/yiisoft/yii2/console/Application.php(180): yii\console\Application->runAction()

8 /new/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction()

9 /new/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest()

10 /new/yii(20): yii\console\Application->run()

11 {main}

*** failed to apply m140608_173539_create_user_table (time: 0.037s) 0 from 10 migrations were applied. Migration failed. The rest of the migrations are canceled.

paskuale75 commented 4 years ago

Sure you followed all the steps? He does it to me without problems

paskuale75 commented 4 years ago

strangely now I have encountered an exception,

*** applying m141207_001649_create_basic_user_permissions
Exception: Invalid path alias: @ webroot / assets (/var/www/html/test-application/vendor/yiisoft/yii2/BaseYii.php:154)

seems to be a baseUrl problem in the console, then in console -> config-> components add this:

'urlManager' => [
            'baseUrl' => 'http://test-application'
]

and in console->config -> aliases:

'@web'      => dirname(dirname(__DIR__)) . '/frontend/web',
 '@webroot'  => dirname(dirname(__DIR__)) . '/frontend/web'
donmedo2000 commented 4 years ago

My database is empty

/new> ./yii migrate --migrationPath=vendor/webvimark/module-user-management/migrations/ Yii Migration Tool (based on Yii v2.0.22)

Total 10 new migrations to be applied: m140608_173539_create_user_table m140611_133903_init_rbac m140808_073114_create_auth_item_group_table m140809_072112_insert_superadmin_to_user m140809_073114_insert_common_permisison_to_auth_item m141023_141535_create_user_visit_log m141116_115804_add_bind_to_ip_and_registration_ip_to_user m141121_194858_split_browser_and_os_column m141201_220516_add_email_and_email_confirmed_to_user m141207_001649_create_basic_user_permissions

Apply the above migrations? (yes|no) [no]:yes *** applying m140608_173539_create_user_table Exception: Trying to get property 'user_table' of non-object (/new/vendor/webvimark/module-user-management/migrations/m140608_173539_create_user_table.php:18)

0 /new/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(725): m140608_173539_create_user_table->up()

1 /new/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(199): yii\console\controllers\MigrateController->migrateUp()

2 /new/vendor/yiisoft/yii2/base/InlineAction.php(57): yii\console\controllers\MigrateController->actionUp()

3 /new/vendor/yiisoft/yii2/base/InlineAction.php(57): ::call_user_func_array:{/new/vendor/yiisoft/yii2/base/InlineAction.php:57}()

4 /new/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams()

5 /new/vendor/yiisoft/yii2/console/Controller.php(148): yii\console\controllers\MigrateController->runAction()

6 /new/vendor/yiisoft/yii2/base/Module.php(528): yii\console\controllers\MigrateController->runAction()

7 /new/vendor/yiisoft/yii2/console/Application.php(180): yii\console\Application->runAction()

8 /new/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction()

9 /new/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest()

10 /new/yii(20): yii\console\Application->run()

11 {main}

*** failed to apply m140608_173539_create_user_table (time: 0.037s) 0 from 10 migrations were applied. Migration failed. The rest of the migrations are canceled.

Got thesame errors too but worked around by substituting table names directly in order to keep moving. I think making the table names in the module static might be an option