bookCases added

This commit is contained in:
Benjamin Takats
2022-12-06 23:56:33 +01:00
parent 3b4af17e49
commit 595530dbf0
12 changed files with 552 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\BookCase;
class BookCaseFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = BookCase::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition(): array
{
return [
'title' => $this->faker->sentence(4),
'lat' => $this->faker->latitude,
'lon' => '{}',
'address' => $this->faker->text,
'type' => $this->faker->word,
'open' => $this->faker->word,
'comment' => $this->faker->text,
'contact' => $this->faker->text,
'bcz' => $this->faker->text,
'digital' => $this->faker->boolean,
'icontype' => $this->faker->word,
'deactivated' => $this->faker->boolean,
'deactreason' => $this->faker->word,
'entrytype' => $this->faker->word,
'homepage' => $this->faker->word,
];
}
}

View File

@@ -0,0 +1,50 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBookCasesTable extends Migration
{
/**
* Run the migrations.
* @return void
*/
public function up(): void
{
Schema::create('book_cases', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->double('lat');
$table->double('lon');
$table->text('address')
->nullable();
$table->string('type');
$table->string('open')
->nullable();
$table->text('comment')
->nullable();
$table->text('contact')
->nullable();
$table->text('bcz')
->nullable();
$table->boolean('digital');
$table->string('icontype');
$table->boolean('deactivated');
$table->string('deactreason');
$table->string('entrytype');
$table->text('homepage')
->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
* @return void
*/
public function down(): void
{
Schema::dropIfExists('book_cases');
}
}

View File

@@ -5,6 +5,7 @@ namespace Database\Seeders;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use App\Console\Commands\Database\CreateTags;
use App\Console\Commands\Feed\ReadAndSyncEinundzwanzigPodcastFeed;
use App\Console\Commands\OpenBooks\SyncOpenBooks;
use App\Models\Category;
use App\Models\City;
use App\Models\Country;
@@ -279,5 +280,6 @@ class DatabaseSeeder extends Seeder
$nonPublicLibrary->libraryItems()
->attach($libraryItem);
Artisan::call(ReadAndSyncEinundzwanzigPodcastFeed::class);
Artisan::call(SyncOpenBooks::class);
}
}