Skip to content

Commit

Permalink
change database config, add bbs table
Browse files Browse the repository at this point in the history
  • Loading branch information
Sline-X committed Apr 18, 2023
1 parent 15be5f4 commit 8a5511d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
|
*/

'default' => env('DB_CONNECTION', 'mysql'),
'default' => env('DB_CONNECTION', 'sqlite'),

/*
|--------------------------------------------------------------------------
Expand All @@ -38,7 +38,7 @@
'sqlite' => [
'driver' => 'sqlite',
'url' => env('DATABASE_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'database' => database_path(env('DB_DATABASE', 'database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
],
Expand Down
31 changes: 31 additions & 0 deletions database/migrations/2023_04_16_204005_create_bbs_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('bbs', function (Blueprint $table) {
$table->id();
$table->string('title', 50);
$table->text('content');
$table->float('price');
$table->timestamps();
$table->index('created_at');
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('bbs');
}
};

0 comments on commit 8a5511d

Please sign in to comment.