Year: 2022
-
Post Views: 19 1. When performing database migration, an error is reported: sqlstate[42000]: Syntax Error or Access Violation: 1059 Identifier nametheme_installation_version_preset_theme_store_theme_version_id_indexis too long. as shown in Figure 1 The index length limit of MySQL 5.7 defaults to 64, while the length of the Theme_Installation_Version_Preset_Theme_Store_Theme_Version_ID_Index is 68. as shown in Figure 2 3. In Laravel 6, each indexing method accepts an…
-
Post Views: 18 1. In Laravel 6’s database migration, when adding a foreign key constraint, Illuminate\Database\QueryException : SQLState[HY000]: General error: 1215 Cannot add foreign key constraint. as shown in Figure 1 2. The code is implemented as follows 3. The code is adjusted as follows, and the error is still reported: 4. The field ASSET_ID type of the table Theme_Asset_Version…
-
Post Views: 19 1. Now the field Theme_Asset of the table Theme_Asset is of type VARCHAR(255). The previous migration code is as follows. as shown in Figure 1 2. Now plan to add a new migration file to modify the type of the field Theme_id is: UUID, that is, char(36). 3. Error: Doctrine\DBAL\Exception : Unknown column type “UUID” requested. As…
-
Post Views: 20 1. Reference:https://www.php.net/manual/zh/ziparchive.extractto.php. ZipArchive::ExtractTo. Extract the compressed file to the specified directory. as shown in Figure 1 2. The final reference implementation is as follows 3. The decompressed directory structure is the same as the original file name and the same name. as shown in Figure 2
-
Post Views: 19 1. Now trying to download the remote zip file to the server. Remote file URL:https://www.shuijingwanwq.com/wp-content/uploads/2021/07/两位老人被两只狗给撞了.wmv 2. Reference:https://guzzle-cn.readthedocs.io/zh_CN/latest/request-options.html#sink. Declare the body part where the response will be saved. as shown in Figure 1 3. Reference:https://www.shuijingwanwq.com/2020/11/26/4627/. The resources returned by fopen() will be written to the PHP stream in response 4. Throw an exception: fopen(e:\wwwroot\object\storage/theme_down loads/2022/05/19/1652927525.7561.1655422634.zip): Failed to open…
-
Post Views: 20 1. Use the following Artisan command to generate a new queue task for the specified module. as shown in Figure 1 2. Task distribution, push tasks to the queue 3. Edit /modules/themestoredb/jobs/themeinstallation.php . The processing example in the queue is mainly to change the value of the field step of the table Theme_Installation_Task to 2. 4. Start…
-
Post Views: 22 1. Now for an API, 4 tables need to be inserted. The 1st table is the table in database A, and the other 3 tables are the table in database B, and the primary key of the 1st table will be inserted into the 2nd table. 2 database connections have been configured. are WordPress and DB respectively.…
-
Post Views: 20 1. Use database transactions in Laravel 6’s Eloquent ORM. The application only uses PHP 7.0 and later, so replace \Exception with \Throwable. Reference:https://stackoverflow.com/questions/49814785/how-can-i-use-transaction-with-eloquent-laravel-5-5 2. The final implementation code is as follows 3. When the transaction fails specially, the third model is inserted into a non-existent field, the transaction is rolled back, and the data is not inserted…
-
Post Views: 59 1. Prompt in Postman: Connection error we were unable to establish a websocket connection with our servers. Please retry. If the issue Persiss, check your network settings to ensure that websocket connections are allowed. 2. Reference: https://github.com/postmanlabs/postman-app-support/issues/9487 . The old account cannot be connected after login, but the new account can be connected. 3. Decide to log…
-
Post Views: 19 1. In Laravle 6’s database migration, the data table option does not support adding comments. as shown in Figure 1 2. Reference:https://stackoverflow.com/questions/37493431/how-to-add-comment-to-table-not-column-in-laravel-5-migration. How to add comment to table (not column) in Laravel 5 migration? 3. The final realization is as follows 4. After performing the database migration, check the execution results, and the table comments have been…