mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Do not try to add the notes column if it already exists on accessories_users
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
aae6a8fc6c
commit
0153c6ae96
|
@ -15,9 +15,16 @@ class MoveAccessoryCheckoutNoteToJoinTable extends Migration
|
||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('accessories_users', function (Blueprint $table) {
|
|
||||||
$table->string('note')->nullable(true)->default(null);
|
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
|
// Loop through the checked out accessories, find their related action_log entry, and copy over the note
|
||||||
// to the newly created note field
|
// to the newly created note field
|
||||||
|
@ -82,8 +89,15 @@ class MoveAccessoryCheckoutNoteToJoinTable extends Migration
|
||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('accessories_users', function (Blueprint $table) {
|
|
||||||
$table->dropColumn('note');
|
if (Schema::hasColumn('accessories_users', 'note'))
|
||||||
});
|
{
|
||||||
|
Schema::table('accessories_users', function (Blueprint $table)
|
||||||
|
{
|
||||||
|
$table->dropColumn('note');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue