]> git.localhorst.tv Git - alttp.git/blob - database/migrations/2023_02_20_084120_create_organizations_table.php
update muffins tracker
[alttp.git] / database / migrations / 2023_02_20_084120_create_organizations_table.php
1 <?php
2
3 use App\Models\Organization;
4 use Illuminate\Database\Migrations\Migration;
5 use Illuminate\Database\Schema\Blueprint;
6 use Illuminate\Support\Facades\Schema;
7
8 return new class extends Migration
9 {
10     /**
11      * Run the migrations.
12      *
13      * @return void
14      */
15     public function up()
16     {
17         Schema::create('organizations', function (Blueprint $table) {
18             $table->id();
19                         $table->string('name')->unique();
20                         $table->text('title');
21             $table->timestamps();
22         });
23
24                 $sg = new Organization();
25                 $sg->name = 'sg';
26                 $sg->title = 'SpeedGaming';
27                 $sg->save();
28     }
29
30     /**
31      * Reverse the migrations.
32      *
33      * @return void
34      */
35     public function down()
36     {
37         Schema::dropIfExists('organizations');
38     }
39 };