Update polls migration, add group support

This commit is contained in:
Daniel Supernault 2021-08-10 22:25:42 -06:00
parent 7709220074
commit bc53ac2af8
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -6,36 +6,37 @@ use Illuminate\Support\Facades\Schema;
class CreatePollsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('polls', function (Blueprint $table) {
$table->bigInteger('id')->unsigned()->primary();
$table->bigInteger('story_id')->unsigned()->nullable()->index();
$table->bigInteger('status_id')->unsigned()->nullable()->index();
$table->bigInteger('profile_id')->unsigned()->index();
$table->json('poll_options')->nullable();
$table->json('cached_tallies')->nullable();
$table->boolean('multiple')->default(false);
$table->boolean('hide_totals')->default(false);
$table->unsignedInteger('votes_count')->default(0);
$table->timestamp('last_fetched_at')->nullable();
$table->timestamp('expires_at')->nullable();
$table->timestamps();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('polls', function (Blueprint $table) {
$table->bigInteger('id')->unsigned()->primary();
$table->bigInteger('story_id')->unsigned()->nullable()->index();
$table->bigInteger('status_id')->unsigned()->nullable()->index();
$table->bigInteger('group_id')->unsigned()->nullable()->index();
$table->bigInteger('profile_id')->unsigned()->index();
$table->json('poll_options')->nullable();
$table->json('cached_tallies')->nullable();
$table->boolean('multiple')->default(false);
$table->boolean('hide_totals')->default(false);
$table->unsignedInteger('votes_count')->default(0);
$table->timestamp('last_fetched_at')->nullable();
$table->timestamp('expires_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('polls');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('polls');
}
}