Skip to content

Commit

Permalink
Add migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
joshembling committed Dec 3, 2023
1 parent 40e101c commit f836df4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 6 additions & 4 deletions database/migrations/create_laragenie_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

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

return new class extends Migration
{
public function up()
{
Schema::create('laragenie_table', function (Blueprint $table) {
Schema::create('laragenie_responses', function (Blueprint $table) {
$table->id();

// add fields

$table->text('question', 50000);
$table->text('answer', 50000)->nullable();
$table->double('cost', 8, 2)->nullable();
$table->json('question_embedding')->default(new Expression('(JSON_ARRAY())'));
$table->timestamps();
});
}
Expand Down
10 changes: 10 additions & 0 deletions src/Models/Laragenie.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class User extends Model
{
protected $table = 'laragenie_responses';
}

0 comments on commit f836df4

Please sign in to comment.