Day 341 – forge laravel installing pgvector with digital ocean

Create a Laravel recipe as per below and then run it against the target server

apt-get update && apt-get install -y postgresql-17-pgvector

You can then make a migration

return new class extends Migration
{
    public function up(): void
    {
        DB::statement('CREATE EXTENSION IF NOT EXISTS vector');
    }

    public function down(): void
    {
        DB::statement('DROP EXTENSION IF EXISTS vector');
    }
};

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *