openvoid-dev / abyss-core

Core code of the Abyss PHP framework
MIT License
2 stars 0 forks source link

Develop ORM Library #2

Open AntonioObra opened 1 month ago

AntonioObra commented 1 month ago

Implement an ORM that supports CRUD operations, relationships, and migrations.

AntonioObra commented 2 weeks ago

In this commit: e93ce7fb4d735e2f1b35b4b7d759b853167576a3:

Created Schema, Migration, Column and Blueprint classes for creating tables. You can now create a full schema for your table, much like in Laravel.

<?php

namespace App\Database\Migrations;

use Abyss\Outsider\Migration;
use Abyss\Outsider\Schema;
use Abyss\Outsider\Blueprint;

class CreateUsersTable extends Migration
{
    public function up()
    {
        Schema::create("users", function (Blueprint $table) {
            $table->id();
            $table->int("age");
            $table->string("name");
            $table->string("city")->nullable();
        });
    }

    public function down()
    {
        Schema::drop("users");
    }
}

There is still a lot to do, like adding a lot more blueprints and types of columns you can create.