Files
dockerfluxodecaixapro/modules/notes/database/migrations/002_create_notes_table.php
T
2026-09-01 10:46:29 -03:00

69 lines
1.9 KiB
PHP
Executable File

<?php
/**
* SysCMS - Content Management System
*
* Copyright (c) 2026 Marco Costa
* All rights reserved.
*
* Author: Marco Costa
* Email: contato@syspanel.com.br
* Project: SysCMS
*
* This software is licensed, not sold.
* Permission is granted to use this software
* subject to the terms of the SysCMS Commercial License.
*
* Redistribution, sublicensing, resale, or
* disclosure of this software, in whole or in part,
* is strictly prohibited without prior written permission.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
*/
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Database\Schema\Blueprint;
/**
* Migration: Create Notes Table
*/
class CreateNotesTable
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
if (!Capsule::schema()->hasTable('notes')) {
Capsule::schema()->create('notes', function (Blueprint $table) {
$table->id('notes_id');
$table->unsignedBigInteger('notes_idbus')->nullable();
$table->unsignedBigInteger('notes_iduser')->nullable();
$table->string('notes_title');
$table->text('notes_content')->nullable();
$table->enum('notes_type', ['note', 'link'])->default('note');
$table->string('notes_url')->nullable();
$table->boolean('notes_is_pinned')->default(false);
$table->string('notes_color')->default('#ffffff');
$table->timestamps();
$table->index('notes_idbus');
$table->index('notes_iduser');
$table->index('notes_type');
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{
Capsule::schema()->dropIfExists('notes');
}
}