D
D
Dmi3ii2019-07-10 10:49:54
Laravel
Dmi3ii, 2019-07-10 10:49:54

How do you deal with migrations in Laravel when passport oauth is already installed?

Good afternoon.
Actually, while I'm roughly planning (experimenting) with the database, I don't want to fix all the changes through separate small migrations.
I often recreate the database ($ php artisan migrate:fresh --seed), losing OAuth data. Then you have to re-install the passport and register the token in the .env file.
How to avoid it? Clean up migration table with *oauth* records in database?
Thank you.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vasyl Fomin, 2019-07-12
@Dmi3ii

Yes, as answered above, you need to use seeds
. For example, I made a seed that simply updated the secret for the application:
after running migrations, installing a passport (passposrt:install), seeds
And already, for example, in postman there is nothing to update for testing, tokens are always the same

J
JhaoDa, 2019-07-10
@JhaoDa

There are seeds for filling the database with all sorts of template / test data, but you can also fill it in migration.

A
Alex Wells, 2019-07-11
@Alex_Wells

In seeds, generate everything you need, incl. and a passport. It is better not to do it in migrations, because they are also launched in production, where it is better to do everything manually.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question