Cant find migrations table when trying to migrate table in laravel - laravel

Im new to laravel and im trying to run php artisan migrate but im getting this error
Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that cor responds to your MariaDB server version for the right syntax to use near '-DYNAM IC' at line 1 (SQL: create table `migrations` (`id` int unsigned not null auto_i ncrement primary key, `migration` varchar(191) not null, `batch` int not null) d efault character set utf8mb4 collate utf8mb4_unicode_ci engine = InnoDB ROW_FORM AT-DYNAMIC)
also mentioning that my database is empty and have no tables, and i had tried to run php artisan migrate:rollback or reset but the console is telling me that no migrations where found

run php artisan migrate:install it will solve the problem

Related

Self hosting Supabase using Postgres

I am trying to self host Supabase with Postgersql (AWS RDS). I have got the db up and running.
I download their docker diretory. It's working fine with the default settings, but when I do it with my postgreSQL,
supabase-auth doesnt seem to work. It give me following error
supabase-auth | time="2022-07-15T14:09:51Z" level=fatal msg="running db migrations: Migrator: problem creating schema migrations: CREATE TABLE \"schema_migrations\" (\n\"version\" VARCHAR (14) NOT NULL\n);\nCREATE UNIQUE INDEX \"schema_migrations_version_idx\" ON \"schema_migrations\" (version);: ERROR: no schema has been selected to create in (SQLSTATE 3F000)"
supabase-auth | [POP] 2022/07/15 14:09:51 info - 2.6074 seconds
supabase-auth exited with code 1
Any help will be appreciated!
Thanks in advance.

can someone help me after i run the composer install

config file
enter image description here
#my appService provider
enter image description here
can someone tell me about this problem after I input composer install that problem says and now I cant migrate
[Illuminate\Database\QueryException] Database (C:\xampp\htdocs\shop2\database\db.sqlite) does not exist. (SQL: PRAGMA foreign_keys=1)
when I run php artisan migrate this problem show
[Illuminate\Database\QueryException]
SQLSTATE[HY000] [1049] Unknown database 'config/database.php' (SQL: select * from information_schema.tables where t
able_schema = config/database.php and table_name = migrations)
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY000] [1049] Unknown database 'config/database.php'
[PDOException]
SQLSTATE[HY000] [1049] Unknown database 'config/database.php'
Create an empty file with name of db.sqlite in your database folder of the app. Then, run php artisan migrate, It will be filled by the app.

Laravel 5 shows error even through it debug mode is set to false and env to production

In Laravel 5.5 I have set both my debug mode to false and env to be production.
Now I make a API call to my app, but it still returns the full 500 error.
I added a column that doesnt exist in a query still outputs this error to the user:
"message": "SQLSTATE[42S22]: Column not found: 1054 Unknown column xxxx..
"exception": "Illuminate\\Database\\QueryException",
I have also tried to do php artisan cache:clear but same result.
I am running laravel through Valet if it matters

Magento 2 SQLSTATE[HY000]: General error: 1823 Failed to add the foreign key constraint

Hello guys I was getting errors with my Magento 2 Store.. Such as Failed API Requests, Swagger gives 500, Stylesheets and JS files won't load etc..
Finally I found that the best solution to create a fresh Magento installation with fresh theme files and just copy pub/media from files and go with maintenance mode to drop all tables prefixed with customers_ , catalog_ , sales_ and eav_
This step made my new store works very good but I got new kind of errors .. I can't run setup:upgrade it shows a message with:
[PDOException] SQLSTATE[HY000]: General error: 1823 Failed to add the foreign key constraint 'porosec_pororom/CAT_CTGR_PRD_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID' to system tables
Error when I run php -f bin/magento setup:db-schema:upgrade
The Command which occur the pervious message
also when I run composer update it updates many of dependencies but it require to run setup:upgrade.
Swagger Error 500
{"0":"Please upgrade your database: Run \"bin/magento setup:upgrade\"
from the Magento root directory.\nThe following modules are
outdated:\nKlarna_Core data: current version - 4.1.5, required version
- 4.2.3\nKlarna_Ordermanagement data: current version - 4.1.2, required version - 4.1.3","1":"#0
/home/porosec/public_html/test/vendor/magento/framework/Interception/Interceptor.php(121):
Magento\Framework\Module\Plugin\DbStatusValidator->beforeDispatch(Object(Magento\Framework\App\FrontController\Interceptor),
Object(Magento\Framework\App\Request\Http))\n#1
/home/porosec/public_html/test/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73):
Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))\n#2
/home/porosec/public_html/test/vendor/magento/framework/Interception/Interceptor.php(135):
Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor),
Object(Closure), Object(Magento\Framework\App\Request\Http))\n#3
/home/porosec/public_html/test/vendor/magento/framework/Interception/Interceptor.php(153):
Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))\n#4
/home/porosec/public_html/test/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26):
Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch',
Array, Array)\n#5
/home/porosec/public_html/test/vendor/magento/framework/App/Http.php(135):
Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))\n#6
/home/porosec/public_html/test/generated/code/Magento/Framework/App/Http/Interceptor.php(24):
Magento\Framework\App\Http->launch()\n#7
/home/porosec/public_html/test/vendor/magento/framework/App/Bootstrap.php(256):
Magento\Framework\App\Http\Interceptor->launch()\n#8
/home/porosec/public_html/test/index.php(39):
Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))\n#9
{main}","url":"/test/swagger","script_name":"/test/index.php"}
Swagger Error log
Also here's what I got in admin dashboard
Admin Panel error
[2018-06-04 23:18:09] main.CRITICAL: Report ID: webapi-5b15c8b17792e; Message: Class "array" does not exist. Please note that namespace must be specified. {"exception":"[object] (Exception(code: 0): Report ID: webapi-5b15c8b17792e; Message: Class \"array\" does not exist. Please note that namespace must be specified. at /home/porosec/public_html/test/vendor/magento/framework/Webapi/ErrorProcessor.php:205, LogicException(code: 0): Class \"array\" does not exist. Please note that namespace must be specified. at /home/porosec/public_html/test/vendor/magento/framework/Reflection/TypeProcessor.php:139)"} []
Admin Panel error log
if you have taken the backup of same table and if foreign key constraint is same as bkp table and current table mysql will throw exception, so change the constraint name or delete the existing constraint.
constraint name should not be same.

in facade.php 221, call to undefined method MySqlBuilder::defaultStringLenght()

in windows command promt full eror it gives same with some php artisan commands
C:\xampp\htdocs\jj>php artisan migrate
In Connection.php line 664:
SQLSTATE[HY000] [1049] Unknown database 'juwelleryjournal' (SQL: select * from information_schema
.tables where table_schema = juwelleryjournal and table_name = migrations)
In Connector.php line 67:
SQLSTATE[HY000] [1049] Unknown database 'juwelleryjournal'
, & php artisan make:"blabla" works well
If you encounter same error, latest windows php version could be an option for you, but it helped only my classmate, not me. The i found on already being in stack overflow (Call to undefined method Illuminate\Database\Schema\MySqlBuilder::defaultStringLength()) and didn't help either. This occurs same on laptop(win7) and desktop pc(win10). I have laravel5.5.28 on both.
Have anyone any suggestions?
Add this to your AppServiceProvider
use Illuminate\Support\Facades\Schema;
function boot()
{
Schema::defaultStringLength(191);
}
Call to undefined method Illuminate\Database\Schema\MySqlBuilder::defaultStringLenght()
=> the method name is wrong, it should be defaultStringLength

Resources