-
-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to Font Awesome 5 (Develop) #957
Merged
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
51f2893
Replace FA4 with FA5. Replace aliased icons (aliasing is deprecated i…
amosfolz 0a9e12e
Update FA5 icon prefix 'fa' to 'fas' to align with new conventions
amosfolz 985f255
Update package.json
amosfolz 41f0e3c
Begin work on new Font Awesome Pro bakery command
amosfolz 8f01f2c
Prompt asking if user wants to continue before asking for auth key.
amosfolz afbab20
Draft of UpdateGroupsTable.php migration
amosfolz 1aaaa5d
Minor style change
amosfolz dbd2bff
add nullable()
amosfolz 8dd1311
merge userfrosting/develop
amosfolz d4afae5
merge userfrosting/develop
amosfolz e89887e
Merge branch 'develop' into fa5
amosfolz c2be62b
StyleCi and confirmation prompt fix
amosfolz 11d018b
Remove default(null) from up
amosfolz 5ed4892
Merge remote-tracking branch 'upstream/develop' into fa5
amosfolz 706caa4
Merge branch 'develop' into pr/957
lcharette 007e9cb
Update package.json
amosfolz 1e07b98
Merge branch 'fa5' into update-fa5
amosfolz 4ae024b
Update icons for Font Awesome 5
amosfolz c3dd512
Update UpdateGroupsTable.php
amosfolz b5d8060
Fix AdmiteLTE.js
amosfolz 5a3d546
Delete SetupFontAwesomeCommand.php
amosfolz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
app/sprinkles/account/src/Database/Migrations/v430/UpdateGroupsTable.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
/** | ||
* UserFrosting (http://www.userfrosting.com) | ||
* | ||
* @link https://github.com/userfrosting/UserFrosting | ||
* @copyright Copyright (c) 2019 Alexander Weissman | ||
* @license https://github.com/userfrosting/UserFrosting/blob/master/LICENSE.md (MIT License) | ||
*/ | ||
|
||
namespace UserFrosting\Sprinkle\Account\Database\Migrations\v430; | ||
|
||
use Illuminate\Database\Schema\Blueprint; | ||
use UserFrosting\Sprinkle\Core\Database\Migration; | ||
|
||
/** | ||
* Groups table migration | ||
* Changes the `icon` column property of `default` to NULL to align with new Font Awesome 5 tag convention. | ||
* Version 4.3.0 | ||
* | ||
* See https://laravel.com/docs/5.4/migrations#tables | ||
* @author Alex Weissman (https://alexanderweissman.com) | ||
*/ | ||
class UpdateGroupsTable extends Migration | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public static $dependencies = [ | ||
'\UserFrosting\Sprinkle\Account\Database\Migrations\v400\GroupsTable' | ||
]; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function up() | ||
{ | ||
if ($this->schema->hasTable('groups')) { | ||
$this->schema->table('groups', function (Blueprint $table) { | ||
$table->string('icon', 100)->default('NULL')->change(); | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function down() | ||
{ | ||
$this->schema->table('groups', function (Blueprint $table) { | ||
$table->string('icon', 100)->default('fas fa-user')->change(); | ||
}); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be null, or an empty string? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went with NULL based off this post: https://stackoverflow.com/questions/38351498/remove-default-in-migration
I also compared to the other columns in the table that did not have a default set when the migration ran, and they all showed
NULL
for theDefault
property. In mysql here is how the results of my testing:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be possible to do an export of the create table logic to see if the default value was truly reversed (the cleaner the better, leftovers attract edge cases).
Assuming I remember, I'll take a look at what the DDL ends up being.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is how "default" migration from
\UserFrosting\Sprinkle\Account\Database\Migrations\v400\GroupsTable.php
looksHere is the result of proposed
UpgradeGroupsTable.php
migrationup
Here is the result of proposed
UpgradeGroupsTable.php
migrationdown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the posted DDL is wrong. Or its mislabeled? I'll still have to look at this myself, but it works as a good reminder none-the-less, so thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am curious about what is wrong?
Other than
('fas fa-user')
in this line, the down method returns the table to the 'original' state. I was not certain how to handle this but I thought it would be better to set the default to use the newfas
convention rather than thefa
.I relabeled my pictures above that might help clear up any confusion.