cristianhu06 / datatables--jest

0 stars 0 forks source link

3. Crear Migrations and Models #3

Open cristianhu06 opened 1 year ago

cristianhu06 commented 1 year ago

php artisan make:model Articulos -m

Tablas de migraciones

public function up()
    {
        Schema::create('articulos', function (Blueprint $table) {
            $table->id();
            $table->string('nombre');
            $table->string('descripcion');

            $table->foreignId('user_id')->constrained()
            ->onDelete('cascade');
            $table->boolean('is_published')->default(false);
            $table->timestamps();
        });
    }
cristianhu06 commented 1 year ago

actualizamos la migracion:

 public function up()
    {
        Schema::create('articulos', function (Blueprint $table) {
            $table->id();
            $table->string('nombre');
            $table->text('descripcion');

            $table->foreignId('user_id')->constrained()
            ->onDelete('cascade');
            $table->boolean('is_published')->default(false);
            $table->integer('sort');
            $table->timestamps();
        });
    }

Image