環境
- Docker for Mac
- laradock
- laravel 5.3
- php7.2
- mysql5.5
これまでの流れ
laradockを用いて環境構築をしています。
・ php-fpm nginx mysql workspaceのコンテナを立ち上げる
・ gitからプロジェクトフォルダをホストOSでworkspaceのフォルダ内にクローン
・ workspaceに入り、.envの作成でdatabaseに接続。(ここはうまく繋がっています)
・ composer install後にmigrateの実行。
すると下記のエラーが発生
[Illuminate\Database\QueryException] SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'customer_id' (SQL: alter table `dtb_cart` add `lx_auth_cookie ` varchar(255) not null, add `customer_id` int not null) [Doctrine\DBAL\Driver\PDOException] SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'customer_id' [PDOException] SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'customer_id'
dbalのインストールを行い下記のようにインストールが完了
$ composer require doctrine/dbal Do not run Composer as root/super user! See https://getcomposer.org/root for details Using version ^2.9 for doctrine/dbal ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 3 installs, 0 updates, 0 removals - Installing doctrine/event-manager (v1.0.0): Loading from cache - Installing doctrine/cache (v1.8.0): Loading from cache - Installing doctrine/dbal (v2.9.2): Loading from cache doctrine/cache suggests installing alcaeus/mongo-php-adapter (Required to use legacy MongoDB driver) Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested. Generating autoload files > Illuminate\Foundation\ComposerScripts::postUpdate > php artisan optimize Generating optimized class loader Compiling common classes
その後もう一度migrateを行なったが、エラーが変わらないままです。
試したこと
・ DB内のテーブルを削除しもう一度migrate
・ docker-compose exec workspace composer require doctrine/dbalでhostOSからインストールしmigrate
1日色々試しましたが進まず困ってしまいました。ご助言よろしくお願い致します。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/05/31 09:10