dehtak

Ahoj, Nevim cim to, ale kdyz dam prikaz artisan migrate tak mi to vyhodi chyby a nevytvori vsechny tabulky a to chci jen vytvorit ty co uz jsou prednastaveny od laravelu (user, failed_jobs...) Microsoft Windows [Verze 6.1.7601] Copyright (c) 2009 Microsoft Corporation. Všechna práva vyhrazena.


w:\008>php artisan migrate
Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table

   Illuminate\Database\QueryException

  SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`))

  at W:\008\vendor\laravel\framework\src\Illuminate\Database\Connection.php:671
    667▕         // If an exception occurs when attempting to run a query, we'll format the error
    668▕         // message to include the bindings with SQL, which will make this exception a
    669▕         // lot more helpful to the developer instead of just the database's errors.
    670▕         catch (Exception $e) {
  ➜ 671▕             throw new QueryException(
    672▕                 $query, $this->prepareBindings($bindings), $e
    673▕             );
    674▕         }
    675▕
     }
    675▕

  1   W:\008\vendor\laravel\framework\src\Illuminate\Database\Connection.php:464
      PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes")

  2   W:\008\vendor\laravel\framework\src\Illuminate\Database\Connection.php:464
      PDOStatement::execute()

Nekde sem udelal chybu nechapu

Ešte nie si členom CZ/SK Laravel komunity?

To možeš ľahko zmeniť. Registrácia je zdarma a ako registrovaný člen získaš množstvo výhod. Prečítaj si prečo by si mal byť členom.

Prihlásiť sa Zaregistrovať
Zoradiť odpovede:
Joshua3234ver
by @Joshua3234ver (5), pred 4 rokmi

This is my first time come here https://my.bankstreet.edu/ICS/Campus_Life/Campus_Groups/Child_Life_Program/Group_Collaboration.jnz?portlet=%5bICS%5d_ForumPortlet&screen=PostView&screenType=change&id=05335e9c-7d60-4d5e-b913-f6cc2e7c8448 http://goddessxuan.com/home.php?mod=space&uid=21160 https://forum.cyberpandit.org/member.php?action=profile&uid=219464 http://kolokolchik237.ru/user/tunacan7/ https://vendetodocomercial.com/author/pipecousin0

[url=http://www.dinglan.cc/forum.php?mod=viewthread&tid=10867&extra=]I am very happy to cme here[/url] [url=http://sc686.net/forum.php?mod=viewthread&tid=22&pid=896782&page=303&extra=page%3D1#pid896782]I am very happy to cme here[/url] [url=https://oynayamayanlar.com/forum/viewtopic.php?f=2&t=11277]I am very happy to cme here[/url] [url=http://www.gugups.com/forum.php?mod=viewthread&tid=503128&extra=]I am very happy to cme here[/url] [url=http://www.qualityman.cn/bbs/forum.php?mod=viewthread&tid=156&pid=215290&page=21503&extra=#pid215290]I am very happy to[/url] [url=https://oodagurus.com/forums/showthread.php?tid=160]I am very happy to cme here[/url] [url=https://www.mfas.nl/wps/portal/home/forum/onderwerp/3628e94c-238a-44a0-84f7-4b83f29cae50/%21ut/p/z1/jZDNbsIwEISfyNqJY4fNkZ8iU5FSBIjEF-RCkgbRJIoQfX0i4Iphbyt9O7MzZCklW7tLVbpz1dTu1O-ZjXZxbGBClnN8BcDQ6G811wa8Bm1vAJ7MEGTfufcA1i-_JeuzAOMBeDQ-Xz3ZtyC7ZJyUZFt3_hVVXTSUNvUh7_7zrqU0jCTnsdoLGbITSjkIVsVAqB8OCxnvXa5BWR91sJuBleEVEl5MAyz1BB_T0ThAdO_CC7R_mxRHfTpqLq_JBDTM/]I am very happy to cme here[/url] [url=http://narutoperso3.free.fr/phpBB3/viewtopic.php?f=2&t=20050]I am very happy to cme here[/url] [url=http://strengkatholisch.de/YaBB.pl]I am very happy to cme here[/url] [url=https://black.volyn.net/forum/viewtopic.php?f=29&t=20811]I am very happy to cme here[/url] 046963e

Elmer1341Jease
by @Elmer1341Jease (5), pred 4 rokmi
Joshua3222ver
by @Joshua3222ver (5), pred 4 rokmi
Dallas211Mig
by @Dallas211Mig (5), pred 4 rokmi
Elmer1321Jease
by @Elmer1321Jease (105), pred 4 rokmi
Elmer11Jease
xvital
by @xvital (460), pred 5 rokmi

Je to tym, ze Laravel defaultne pouziva kodovanie utf8mb4 a v MySQL v. < 5.7.7 a MariaDB < 10.2.2 sa tam tieto kluce nezmestia.

Jednoduchy fix je zavolat v boot metode v AppServiceProvider toto:

Schema::defaultStringLength(191);

cim sa zabezpeci nastavenie pozadovanej dlzky indexov.

Viac info tu: https://laravel.com/docs/7.x/migrations#creating-indexes (Index Lengths & MySQL / MariaDB)