luyadev / luya

LUYA is a scalable web framework and content management system with the goal to please developers, clients and users alike.
https://luya.io
MIT License
812 stars 207 forks source link

Install problem #1792

Closed nazakar closed 5 years ago

nazakar commented 6 years ago

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 commented 6 years ago

are you upgrading from an old system?

nadar commented 6 years ago

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 commented 6 years ago

New installation - postgresql migrate run OK

nazakar commented 6 years ago

I'm installinf fresh luya from setup guide

luya-kickstarter

composer create-project luyadev/luya-kickstarter:~1.0.0

2018-04-13 10:45 GMT+03:00 Basil notifications@github.com:

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/luyadev/luya/issues/1792#issuecomment-381052902, or mute the thread https://github.com/notifications/unsubscribe-auth/ALawJnWopfu670-9wjiB1laAL7gxE41bks5toFeHgaJpZM4TS-0p .

-- Nazelina Karanfilian

dev7ch commented 6 years ago

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

nadar commented 6 years ago

@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 commented 6 years ago

I'll try with mysql thank you

На пт, 13 апр 2018 г., 12:13 Basil notifications@github.com написа:

@dev7ch https://github.com/dev7ch nothing has changed since latest release so why using dev master?

@nazakar https://github.com/nazakar maybe its related to postgresql, do you have another engine just for testing?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/luyadev/luya/issues/1792#issuecomment-381075619, or mute the thread https://github.com/notifications/unsubscribe-auth/ALawJhKbkXqxXvY1XP7qQxqHhM15F4dUks5toGwzgaJpZM4TS-0p .

nazakar commented 6 years ago

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('m171129104706...')

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 commented 6 years ago

But with mysql everything works fine?

nadar commented 6 years ago

@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 commented 6 years ago

There is no problem with mysql - every thing works fine. Migration error only with postgres

2018-04-13 14:57 GMT+03:00 Basil notifications@github.com:

@ricpelo https://github.com/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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/luyadev/luya/issues/1792#issuecomment-381113231, or mute the thread https://github.com/notifications/unsubscribe-auth/ALawJl56a_NL9R71R2rIorkTyvnrEgMAks5toJKzgaJpZM4TS-0p .

-- Nazelina Karanfilian

nadar commented 6 years ago

Ok, will do some research. thanks

nadar commented 6 years ago

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 commented 5 years ago

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