Files
CRM/database/migrations/2017_12_24_115641_create_pets_table.php
Kroonk a213a1dba0
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
refactor: replace custom CRM with Monica fork
2026-05-22 16:19:55 +02:00

46 lines
1.8 KiB
PHP

<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('pets', function (Blueprint $table) {
$table->increments('id');
$table->integer('account_id');
$table->integer('contact_id');
$table->integer('pet_category_id');
$table->string('name')->nullable();
$table->timestamps();
});
Schema::create('pet_categories', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->boolean('is_common');
$table->timestamps();
});
DB::table('pet_categories')->insert(['name' => 'reptile', 'is_common' => false]);
DB::table('pet_categories')->insert(['name' => 'bird', 'is_common' => false]);
DB::table('pet_categories')->insert(['name' => 'cat', 'is_common' => true]);
DB::table('pet_categories')->insert(['name' => 'dog', 'is_common' => true]);
DB::table('pet_categories')->insert(['name' => 'fish', 'is_common' => true]);
DB::table('pet_categories')->insert(['name' => 'hamster', 'is_common' => false]);
DB::table('pet_categories')->insert(['name' => 'horse', 'is_common' => false]);
DB::table('pet_categories')->insert(['name' => 'rabbit', 'is_common' => false]);
DB::table('pet_categories')->insert(['name' => 'rat', 'is_common' => false]);
DB::table('pet_categories')->insert(['name' => 'small_animal', 'is_common' => false]);
DB::table('pet_categories')->insert(['name' => 'other', 'is_common' => false]);
}
}