Skip to content
Snippets Groups Projects
Commit 0153c6ae authored by snipe's avatar snipe
Browse files

Do not try to add the notes column if it already exists on accessories_users


Signed-off-by: default avatarsnipe <snipe@snipe.net>
parent aae6a8fc
Branches
No related tags found
No related merge requests found
......@@ -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');
});
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment