Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SnipeIt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OskarStenberg
SnipeIt
Commits
0153c6ae
Commit
0153c6ae
authored
4 years ago
by
snipe
Browse files
Options
Downloads
Patches
Plain Diff
Do not try to add the notes column if it already exists on accessories_users
Signed-off-by:
snipe
<
snipe@snipe.net
>
parent
aae6a8fc
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
database/migrations/2020_10_22_233743_move_accessory_checkout_note_to_join_table.php
+20
-6
20 additions, 6 deletions
..._22_233743_move_accessory_checkout_note_to_join_table.php
with
20 additions
and
6 deletions
database/migrations/2020_10_22_233743_move_accessory_checkout_note_to_join_table.php
+
20
−
6
View file @
0153c6ae
...
...
@@ -14,10 +14,17 @@ class MoveAccessoryCheckoutNoteToJoinTable extends Migration
* @return void
*/
public
function
up
()
{
if
(
!
Schema
::
hasColumn
(
'accessories_users'
,
'note'
))
{
Schema
::
table
(
'accessories_users'
,
function
(
Blueprint
$table
)
{
$table
->
string
(
'note'
)
->
nullable
(
true
)
->
default
(
null
);
});
}
// Loop through the checked out accessories, find their related action_log entry, and copy over the note
// to the newly created note field
...
...
@@ -82,8 +89,15 @@ class MoveAccessoryCheckoutNoteToJoinTable extends Migration
*/
public
function
down
()
{
Schema
::
table
(
'accessories_users'
,
function
(
Blueprint
$table
)
{
if
(
Schema
::
hasColumn
(
'accessories_users'
,
'note'
))
{
Schema
::
table
(
'accessories_users'
,
function
(
Blueprint
$table
)
{
$table
->
dropColumn
(
'note'
);
});
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment