ContestSubmissions::up PHP Method

up() public method

Run the migrations.
public up ( ) : void
return void
    public function up()
    {
        Schema::table('contests', function (Blueprint $table) {
            //using raw sql because https://github.com/laravel/framework/issues/1186
            //fix ends_at not being nullable (else mysql makes it on_update_current_timestamp)
            DB::statement('ALTER TABLE contests CHANGE ends_at voting_ends_at TIMESTAMP NULL');
            DB::statement('ALTER TABLE contests CHANGE description description_voting TEXT');
        });
        Schema::table('contests', function (Blueprint $table) {
            $table->timestamp('entry_starts_at')->nullable()->after('show_votes');
            $table->timestamp('entry_ends_at')->nullable()->after('entry_starts_at');
            $table->timestamp('voting_starts_at')->nullable()->after('entry_ends_at');
            $table->text('description_enter')->after('name');
        });
    }
ContestSubmissions