This commit is contained in:
2026-02-12 17:56:16 +00:00
parent a4f80c85c2
commit 2ffd916e2f
27 changed files with 1181 additions and 60 deletions

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->integer('id_escola')->nullable();
$table->string('profile')->nullable();
$table->string('cpf')->nullable();
$table->json('endereco')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
//
});
}
};

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->integer('id_escola')->nullable()->after('created_at')->change();
$table->string('profile')->nullable()->after('id_escola')->change();
$table->string('cpf')->nullable()->after(column: 'profile')->change();
$table->json('endereco')->nullable()->after('cpf')->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
//
});
}
};

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('escolas', function (Blueprint $table) {
$table->id();
$table->string('cnpj')->unique();
$table->string('nome');
$table->json('endereco');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('escolas');
}
};

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('turmas', function (Blueprint $table) {
$table->id();
$table->integer('id_escola');
$table->string('nome');
$table->string('descricao');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('turmas');
}
};

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('alunos', function (Blueprint $table) {
$table->id();
$table->integer('id_responsavel');
$table->integer('id_turma');
$table->string('nome');
$table->date('data_nascimento');
$table->date('data_inscricao');
$table->date('data_encerramento');
$table->string('cpf')->unique();
$table->json('endereco');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('alunos');
}
};

View File

@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('historico_escolars', function (Blueprint $table) {
$table->id();
$table->integer('id_aluno');
$table->longText('historico');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('historico_escolars');
}
};

View File

@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('alunos', function (Blueprint $table) {
$table->date('data_encerramento')->nullable()->change();
$table->json('endereco')->nullable()->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('alunos', function (Blueprint $table) {
//
});
}
};

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('turmas', function (Blueprint $table) {
$table->string('id_whatsapp');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('turmas', function (Blueprint $table) {
//
});
}
};