GithubHelp home page GithubHelp logo

Comments (17)

bizley avatar bizley commented on August 11, 2024 1

By running some SQL query using the app. Anyway, interesting, maybe indeed DB schema cache is the reason, do you have it switched on?

from yii2-gii.

bizley avatar bizley commented on August 11, 2024 1

We are talking here about several things at the same time so it would be nice to extract a single thing into a separate issue if you find something not working properly. As for the builder documentation I'm afraid I cannot help you with that since Gii docs are quite minimal, it would be nice to have it completed.

from yii2-gii.

bizley avatar bizley commented on August 11, 2024

Make sure your application has access to this database and the table.

from yii2-gii.

glodov avatar glodov commented on August 11, 2024

Make sure your application has access to this database and the table.

Of course. It is.

cat config/dynamic.php 
<?php return [
    'components' => [
        'db' => [
            'class' => 'yii\\db\\Connection',
            'dsn' => 'mysql:host=localhost;dbname=intranet',
            'username' => 'root',
            'password' => 'root',
        ],
...

Entering and checking with the same user with MySQL (MariaDB) console.

mysql -u root -p

MariaDB [(none)]> use intranet;
Database changed
MariaDB [intranet]> show tables like "uacademy_%";

+---------------------------------+
| Tables_in_intranet (uacademy_%) |
+---------------------------------+
| uacademy_persona                |
+---------------------------------+
1 row in set (0.001 sec)

MariaDB [intranet]> select * from uacademy_persona;
Empty set (0.002 sec)

MariaDB [intranet]> insert into uacademy_persona values ();
Query OK, 1 row affected (0.003 sec)

MariaDB [intranet]> select * from uacademy_persona;
+----+
| id |
+----+
|  1 |
+----+
1 row in set (0.000 sec)

It seems framework is trying to get data from the table (even with the generator) before creating it.

from yii2-gii.

schmunk42 avatar schmunk42 commented on August 11, 2024

Do you have other tables referencing uacademy_persona by FK?

AFAIR gii reads all tables and sometimes mixes up table names when using ie. a table_prefix.

from yii2-gii.

bizley avatar bizley commented on August 11, 2024

So far I don't see any proof that the app has access to the database, you are showing only the db console.

from yii2-gii.

glodov avatar glodov commented on August 11, 2024

Make sure your application has access to this database and the table.

And today it works.
After such manipulation of inserting data into the table.
I think it's some kind of cache, and it would be perfect to understand which one.

Now I have removed the table and the migration generator works.

Do you have other tables referencing uacademy_persona by FK?

AFAIR gii reads all tables and sometimes mixes up table names when using ie. a table_prefix.

Nope.
Works well now.

I don't understand why it did not work yesterday.

from yii2-gii.

glodov avatar glodov commented on August 11, 2024

So far I don't see any proof that the app has access to the database, you are showing only the db console.

How can I make a proof for you otherwise than a console (good to know for future reporting)?

from yii2-gii.

glodov avatar glodov commented on August 11, 2024

By running some SQL query using the app. Anyway, interesting, maybe indeed DB schema cache is the reason, do you have it switched on?

I though so, and so I used the command from the terminal to clear the cache, but it did not help.

My config for the cache is:

<?php return [
    'components' => [
        'cache' => [
            'class' => 'yii\\caching\\FileCache',
            'keyPrefix' => 'humhub',
        ],
// ...

and now I have another issue with the popuping up the preview of the file.
I've recorded a screen with the explanation, it is available here: https://youtu.be/86Lc_MJ9jKQ.
I have my dark theme enabled (external CSS for the generator) but even with the disabled dark theme popup is not visible.

from yii2-gii.

bizley avatar bizley commented on August 11, 2024

Is it possible that some Humhub component is breaking that? I'm not familiar with Humhub so I'm afraid I won't be able to help. Please double check the browser console for any network and JS errors as well.

from yii2-gii.

glodov avatar glodov commented on August 11, 2024

Is it possible that some Humhub component is breaking that? I'm not familiar with Humhub so I'm afraid I won't be able to help. Please double check the browser console for any network and JS errors as well.

No errors.
The response is very correct with the preview of the file, and more interesting, there is the correct HTML code generated and almost visible on the highest level with z-index, but it is transparent.

If you have time (5 minutes) to check, I've recorded another video with the research on this transparency error.
Here is the video: https://youtu.be/ing9zx4bDYU.

My experience tells me it is not related to HumHub, it is pure Yii2 generator run in the browser as a part of HumHub platform.

from yii2-gii.

glodov avatar glodov commented on August 11, 2024

I found an issue.
It's an opacity of the .fade class for the modal dialog.
I shall try to make a pull request with the fix.

from yii2-gii.

glodov avatar glodov commented on August 11, 2024

And again, I have the same issue after I removed the table.
It makes no sense to require an existent table in the generator module.
How can migrations be created then?

from yii2-gii.

bizley avatar bizley commented on August 11, 2024

What do you mean? Is there a table or is there not? Do you want to generate a model based on it or a migration?

from yii2-gii.

glodov avatar glodov commented on August 11, 2024

What do you mean? Is there a table or is there not? Do you want to generate a model based on it or a migration?

No table.
When I created it manually it worked without any error, but migration did not run. Nothing new to migrate.

When I removed the table, it continues to show an error on the step of preview or generation of migration file.

It makes no sense to create a table manually in the database, this is why I use a migration generator to generate it without errors.

I am going to dig into the architecture of the migration process and try to fix it.

from yii2-gii.

glodov avatar glodov commented on August 11, 2024

What do you mean? Is there a table or is there not? Do you want to generate a model based on it or a migration?

When the checkbox "Only by phpdoc annotation" is checked there is no error. When it's unchecked generator throws an error. Should a message or hint be added here for this checkbox?

I've spent quite some time figuring this out.

Only by phpdoc annotation

And now, I have an issue with the "object" column type.
And the yii\db\SchemaBuilderTrait does not have such a function object() but it has json() which is not described in phpdoc annotation.
But it works with "json" in the way to create "longtext" in MariaDB.

What would you suggest to improve @bizley to help developers to understand this builder with no errors and with the correct json format?

from yii2-gii.

glodov avatar glodov commented on August 11, 2024

Thanks.

This question is already part of the migration generator module, so it's issued here Insolita/yii2-migrik#49

from yii2-gii.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.