Skip to content

Commit

Permalink
Merge pull request #16 from thedevdojo/fixingConditionalColumns
Browse files Browse the repository at this point in the history
Adding updates to schema
  • Loading branch information
tnylea authored May 21, 2024
2 parents 303b059 + eac9c78 commit ee19d01
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ jobs:
- name: Publish the DevDojo Configs
run: php artisan vendor:publish --tag=auth:config
working-directory: ./laravel_app

- name: Publish the DevDojo Auth Migrations
run: php artisan vendor:publish --tag=auth:migrations
working-directory: ./laravel_app

- name: Remove current tests and symlink to DevDojo Auth
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ public function up(): void
{
Schema::table('users', function (Blueprint $table) {

if (! $table->hasColumn('two_factor_secret')) {
if (! Schema::hasColumn('users', 'two_factor_secret')) {
$table->text('two_factor_secret')
->after('password')
->nullable();
}

if (! $table->hasColumn('two_factor_recovery_codes')) {
if (! Schema::hasColumn('users', 'two_factor_recovery_codes')) {
$table->text('two_factor_recovery_codes')
->after('two_factor_secret')
->nullable();
}

if (! $table->hasColumn('two_factor_confirmed_at')) {
if (! Schema::hasColumn('users', 'two_factor_confirmed_at')) {
$table->timestamp('two_factor_confirmed_at')
->after('two_factor_recovery_codes')
->nullable();
Expand Down

0 comments on commit ee19d01

Please sign in to comment.