Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install problem #1792

Closed
nazakar opened this issue Apr 13, 2018 · 14 comments · Fixed by luyadev/luya-module-admin#343
Closed

Install problem #1792

nazakar opened this issue Apr 13, 2018 · 14 comments · Fixed by luyadev/luya-module-admin#343
Assignees

Comments

@nazakar
Copy link

nazakar commented Apr 13, 2018

What steps will reproduce the problem?

php index.php import

What is the expected result?

Getting unknown property: luya\admin\models\Config::is_system

What do you get instead? (A Screenshot can help us a lot!)

LUYA Check ouput (run this script and post the result: luyacheck.php)

Additional infos

Q A
LUYA Version
PHP Version 7
Platform Apache/XAMPP/MAMPP/etc.
Operating system Windows/
@nadar
Copy link
Contributor

nadar commented Apr 13, 2018

are you upgrading from an old system?

  • run migrate
  • provide use composer.json

@nadar
Copy link
Contributor

nadar commented Apr 13, 2018

I just did a short check: is_system has been added on 29 Nov 2017, so it was part of the 1.0.0 release. Maybe you are still running RC4.

So you can try to just run migrate and get more infos in the upgrade doc: https://github.com/luyadev/luya/blob/master/core/UPGRADE.md

Or just install a fresh luya kickstarter

@nazakar
Copy link
Author

nazakar commented Apr 13, 2018

New installation - postgresql migrate run OK

@nazakar
Copy link
Author

nazakar commented Apr 13, 2018 via email

@dev7ch
Copy link
Contributor

dev7ch commented Apr 13, 2018

you could try composer create-project luyadev/luya-kickstarter:dev-master

@nadar
Copy link
Contributor

nadar commented Apr 13, 2018

@dev7ch nothing has changed since latest release so why using dev master?

@nazakar maybe its related to postgresql, do you have another engine just for testing?

@nazakar
Copy link
Author

nazakar commented Apr 13, 2018 via email

@nazakar
Copy link
Author

nazakar commented Apr 13, 2018

a little progress but still problem
*** applying m171129_104706_config_add_system_type
> add column is_system boolean DEFAULT TRUE to table admin_config ... done (time: 0.120s)
> drop primary key name ...Exception: SQLSTATE[42704]: Undefined object: 7 ERROR: constraint "name" of relation "admin_config" does not exist
The SQL being executed was: ALTER TABLE "admin_config" DROP CONSTRAINT "name" (E:\web_dev\xampp\htdocs\luya-kickstarter\vendor\yiisoft\yii2\db\Schema.php:664)
#0 E:\web_dev\xampp\htdocs\luya-kickstarter\vendor\yiisoft\yii2\db\Command.php(1263): yii\db\Schema->convertException(Object(PDOException), 'ALTER TABLE "ad...')
#1 E:\web_dev\xampp\htdocs\luya-kickstarter\vendor\yiisoft\yii2\db\Command.php(1075): yii\db\Command->internalExecute('ALTER TABLE "ad...')
#2 E:\web_dev\xampp\htdocs\luya-kickstarter\vendor\yiisoft\yii2\db\Migration.php(449): yii\db\Command->execute()
#3 E:\web_dev\xampp\htdocs\luya-kickstarter\vendor\luyadev\luya-module-admin\src\migrations\m171129_104706_config_add_system_type.php(17): yii\db\Migration->dropPrimaryKey('name', 'admin_config')
#4 E:\web_dev\xampp\htdocs\luya-kickstarter\vendor\yiisoft\yii2\db\Migration.php(114): m171129_104706_config_add_system_type->safeUp()
#5 E:\web_dev\xampp\htdocs\luya-kickstarter\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php(725): yii\db\Migration->up()
#6 E:\web_dev\xampp\htdocs\luya-kickstarter\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php(199): yii\console\controllers\BaseMigrateController->migrateUp('m171129_104706_...')
#7 [internal function]: yii\console\controllers\BaseMigrateController->actionUp(0)
#8 E:\web_dev\xampp\htdocs\luya-kickstarter\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)
#9 E:\web_dev\xampp\htdocs\luya-kickstarter\vendor\yiisoft\yii2\base\Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#10 E:\web_dev\xampp\htdocs\luya-kickstarter\vendor\yiisoft\yii2\console\Controller.php(148): yii\base\Controller->runAction('', Array)
#11 E:\web_dev\xampp\htdocs\luya-kickstarter\vendor\yiisoft\yii2\base\Module.php(528): yii\console\Controller->runAction('', Array)
#12 E:\web_dev\xampp\htdocs\luya-kickstarter\vendor\yiisoft\yii2\console\Application.php(180): yii\base\Module->runAction('migrate', Array)
#13 E:\web_dev\xampp\htdocs\luya-kickstarter\vendor\yiisoft\yii2\console\Application.php(147): yii\console\Application->runAction('migrate', Array)
#14 E:\web_dev\xampp\htdocs\luya-kickstarter\vendor\yiisoft\yii2\base\Application.php(386): yii\console\Application->handleRequest(Object(yii\console\Request))
#15 E:\web_dev\xampp\htdocs\luya-kickstarter\vendor\luyadev\luya-core\base\Boot.php(205): yii\base\Application->run()
#16 E:\web_dev\xampp\htdocs\luya-kickstarter\vendor\luyadev\luya-core\base\Boot.php(162): luya\base\Boot->applicationConsole()
#17 E:\web_dev\xampp\htdocs\luya-kickstarter\public_html\index.php(8): luya\base\Boot->run()
#18 {main}
*** failed to apply m171129_104706_config_add_system_type (time: 0.130s)
I added manualy column is_system but admin panel login not working

@nadar
Copy link
Contributor

nadar commented Apr 13, 2018

But with mysql everything works fine?

@nadar
Copy link
Contributor

nadar commented Apr 13, 2018

@ricpelo was helping us with the postgre implementation this is the migration file, maybe he has an idea. Or will check with postgre later if you can confirm its working with mysql.

https://github.com/luyadev/luya-module-admin/blob/master/src/migrations/m171129_104706_config_add_system_type.php

@nazakar
Copy link
Author

nazakar commented Apr 13, 2018 via email

@nadar
Copy link
Contributor

nadar commented Apr 14, 2018

Ok, will do some research. thanks

@nadar
Copy link
Contributor

nadar commented Apr 14, 2018

So the problem seems to appear here:

drop primary key name ...Exception: SQLSTATE[42704]: Undefined object: 7 ERROR: constraint "name" of relation "admin_config" does not exist
The SQL being executed was: ALTER TABLE "admin_config" DROP CONSTRAINT "name" 

while doing this:

https://github.com/luyadev/luya-module-admin/blob/master/src/migrations/m171129_104706_config_add_system_type.php#L17

@boehsermoe
Copy link
Member

In postgreSql the primary key naming is with the suffix "_pkey" and the Yii querybuilder does not handle this.
In this migration where the table is create, the primary key have to be naming.
It should be CONSTRAINT name PRIMARY KEY (name)

SQL example: https://www.db-fiddle.com/f/5zDyxGHMfsSuhDb77fpaGk/3

boehsermoe added a commit to boehsermoe/luya-module-admin that referenced this issue Aug 14, 2019
nadar pushed a commit to luyadev/luya-module-admin that referenced this issue Aug 14, 2019
* Installation problem with postgresql

close luyadev/luya/issues/1792

* Add primary key via `addPrimaryKey` function

* Update CHANGELOG.md
slowfox089 pushed a commit to slowfox089/luya-module-admin that referenced this issue Dec 10, 2020
* Installation problem with postgresql

close luyadev/luya/issues/1792

* Add primary key via `addPrimaryKey` function

* Update CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants