Squashed commit of the following:

commit 41ab44ed1d86a1d0788089cf2d79e3c9ab8e2ba6
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Aug 9 20:58:13 2017 +0100

    Add a test for a swarm checkin with no text

commit b4986ba3207374d11438e00d05a6f1ae1720bd49
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Aug 9 20:57:44 2017 +0100

    A migration that makes the note column of the notes table nullable

commit 80ac4d38c992e59733f60e844f376e36507fb8ee
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Aug 9 20:57:04 2017 +0100

    Don’t fail when the text content of a note is empty

commit 874acdd3b31028c06d19cdbe9ef34bbc9660a704
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Aug 9 20:55:12 2017 +0100

    Allow no content for the actual note, maybe its just a picture. Also provide some context for swarm checkins
This commit is contained in:
Jonny Barnes 2017-08-09 20:59:22 +01:00
parent d28df644bc
commit e3fff4b9a8
4 changed files with 75 additions and 1 deletions

View file

@ -0,0 +1,34 @@
<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AllowEmptyNoteContent extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('notes', function (Blueprint $table) {
DB::statement('ALTER TABLE notes ALTER note DROP NOT NULL');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('notes', function (Blueprint $table) {
// we dont reverse this because we cant know if there
// are NULL entries, in which case SET NOT NULL will fail
});
}
}