mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
meetups added
This commit is contained in:
@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateEventsTable extends Migration
|
||||
class CreateCourseEventsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
@@ -15,7 +15,7 @@ class CreateEventsTable extends Migration
|
||||
{
|
||||
Schema::disableForeignKeyConstraints();
|
||||
|
||||
Schema::create('events', function (Blueprint $table) {
|
||||
Schema::create('course_events', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('course_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate();
|
||||
$table->foreignId('venue_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate();
|
||||
@@ -34,6 +34,6 @@ class CreateEventsTable extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('events');
|
||||
Schema::dropIfExists('course_events');
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ class CreateRegistrationsTable extends Migration
|
||||
|
||||
Schema::create('registrations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('event_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate()->primary();
|
||||
$table->foreignId('course_event_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate()->primary();
|
||||
$table->foreignId('participant_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate()->primary();
|
||||
$table->boolean('active')->default(true);
|
||||
$table->timestamps();
|
||||
|
||||
@@ -11,7 +11,7 @@ return new class extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
Schema::table('course_events', function (Blueprint $table) {
|
||||
$table->string('link');
|
||||
});
|
||||
}
|
||||
@@ -22,7 +22,7 @@ return new class extends Migration {
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
Schema::table('course_events', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateMeetupsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::disableForeignKeyConstraints();
|
||||
|
||||
Schema::create('meetups', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('city_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate();
|
||||
$table->string('name')->unique();
|
||||
$table->string('link');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::enableForeignKeyConstraints();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('meetups');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateMeetupEventsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::disableForeignKeyConstraints();
|
||||
|
||||
Schema::create('meetup_events', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('meetup_id')
|
||||
->constrained()
|
||||
->cascadeOnDelete()
|
||||
->cascadeOnUpdate();
|
||||
$table->dateTime('start');
|
||||
$table->string('location')
|
||||
->nullable();
|
||||
$table->text('description')
|
||||
->nullable();
|
||||
$table->string('link')
|
||||
->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::enableForeignKeyConstraints();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('meetup_events');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user