Skip to content

Commit

Permalink
docs(migration doc) migration doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
AliciaMV committed May 5, 2022
1 parent 99da7eb commit 37d62a6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Homestead.json
Homestead.yaml
.env
.phpunit.result.cache
Procedure_migrate_db.md
24 changes: 14 additions & 10 deletions Procedure_migrate_db.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
use Flipbox\LumenGenerator\LumenGeneratorServiceProvider;
## Flipbox setup

terminal
composer require flipbox/lumen-generator
use Flipbox\LumenGenerator\LumenGeneratorServiceProvider;

copier code dans fichier boostrap/app.php
Inside your bootstrap/app.php file, add:
$app->register(Flipbox\LumenGenerator\LumenGeneratorServiceProvider::class);
`composer require flipbox/lumen-generator`

Inside your bootstrap/app.php file, in the 'Register Service Providers' section, add:
`$app->register(Flipbox\LumenGenerator\LumenGeneratorServiceProvider::class);`

//generation tables bdd
```php artisan key:generate
php artisan make:model users -fmc```
Generate the key that will connect our app to the DB
`php artisan key:generate`
The genrated key will automatically be copied in the .env file.

//apres cette commande modifier fichier generé dans database/migrations
### Create new migration
This command will create a new migration file into the database folder and a model file for the new table
`php artisan make:model users -fmc`
In the migration file, add the properties you want to appear in the table and then send it for creation to the DB with this command:
`php artisan migrate`



// pour rajouter colonne dans table existante
//ensuite relancer php artisan migration apres avois rajouté dans le nouveau fichier la ligne a rajouter dans la function de la classe
```
Expand Down
4 changes: 2 additions & 2 deletions database/factories/usersFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public function definition(): array
'firstname' => $this->faker->firstName,
'email_address' => $this->faker->safeEmail,
'password' => $this->faker->password,
'phone' => $this->faker->phoneNumber,
'dev_id' => $this->faker->randomDigit,
//'phone' => $this->faker->phoneNumber,
//'dev_id' => $this->faker->randomDigit,
'recrut_id' => $this->randomDigit,
'subscribe_to_push_notif' => $this->faker->boolean,
'profile_picture' => $this->faker->url,
Expand Down

0 comments on commit 37d62a6

Please sign in to comment.