First Commit

This commit is contained in:
marco
2026-09-01 10:46:29 -03:00
commit bf96b77e9c
10000 changed files with 3508600 additions and 0 deletions
@@ -0,0 +1,49 @@
<?php
use Illuminate\Database\Capsule\Manager as Capsule;
/**
* Migration 006: Add attachments to notes table.
*
* This migration adds columns for images and files to the notes table.
*/
class AddAttachmentsToNotes
{
/**
* Run the migration.
*
* @return void
*/
public function up()
{
if (Capsule::schema()->hasTable('notes')) {
Capsule::schema()->table('notes', function ($table) {
if (!Capsule::schema()->hasColumn('notes', 'notes_image')) {
$table->string('notes_image')->nullable()->after('notes_color');
}
if (!Capsule::schema()->hasColumn('notes', 'notes_file')) {
$table->string('notes_file')->nullable()->after('notes_image');
}
});
}
}
/**
* Reverse the migration.
*
* @return void
*/
public function down()
{
if (Capsule::schema()->hasTable('notes')) {
Capsule::schema()->table('notes', function ($table) {
if (Capsule::schema()->hasColumn('notes', 'notes_image')) {
$table->dropColumn('notes_image');
}
if (Capsule::schema()->hasColumn('notes', 'notes_file')) {
$table->dropColumn('notes_file');
}
});
}
}
}