🌱 🏗️ ⬆️ ✨add expense table 🎨 🔧
This commit is contained in:
@@ -11,7 +11,7 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('type_expanses', function (Blueprint $table) {
|
||||
Schema::create('type_expenses', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('label');
|
||||
});
|
||||
@@ -22,6 +22,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('type_expanses');
|
||||
Schema::dropIfExists('type_expenses');
|
||||
}
|
||||
};
|
||||
@@ -11,18 +11,18 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('previsional_expanses', function (Blueprint $table) {
|
||||
Schema::create('previsional_expenses', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('id_user');
|
||||
$table->unsignedBigInteger('id_type_expanse');
|
||||
$table->unsignedBigInteger('id_type_expenses');
|
||||
$table->double('amount')->default(0);
|
||||
$table->string('description', 200)->default('');
|
||||
$table->date('date');
|
||||
|
||||
$table->foreign('id_user')
|
||||
->references('id')->on('users');
|
||||
$table->foreign('id_type_expanse')
|
||||
->references('id')->on('type_expanses');
|
||||
$table->foreign('id_type_expenses')
|
||||
->references('id')->on('type_expenses');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
@@ -32,6 +32,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('previsional_expanses');
|
||||
Schema::dropIfExists('previsional_expenses');
|
||||
}
|
||||
};
|
||||
@@ -11,18 +11,18 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('expanses', function (Blueprint $table) {
|
||||
Schema::create('expenses', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('id_user');
|
||||
$table->unsignedBigInteger('id_type_expanse');
|
||||
$table->unsignedBigInteger('id_type_expenses');
|
||||
$table->double('amount')->default(0);
|
||||
$table->string('description', 200)->default('');
|
||||
$table->date('date');
|
||||
|
||||
$table->foreign('id_user')
|
||||
->references('id')->on('users');
|
||||
$table->foreign('id_type_expanse')
|
||||
->references('id')->on('type_expanses');
|
||||
$table->foreign('id_type_expenses')
|
||||
->references('id')->on('type_expenses');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
@@ -32,6 +32,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('expanses');
|
||||
Schema::dropIfExists('expenses');
|
||||
}
|
||||
};
|
||||
@@ -13,7 +13,7 @@ return new class extends Migration
|
||||
{
|
||||
Schema::create('recurring_expenses', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('id_type_expanse');
|
||||
$table->unsignedBigInteger('id_type_expenses');
|
||||
$table->unsignedBigInteger('id_recurring');
|
||||
$table->unsignedBigInteger('id_user');
|
||||
$table->double('amount')->default(0);
|
||||
@@ -21,8 +21,8 @@ return new class extends Migration
|
||||
$table->date('date');
|
||||
$table->date('end_date')->nullable();
|
||||
|
||||
$table->foreign('id_type_expanse')
|
||||
->references('id')->on('type_expanses');
|
||||
$table->foreign('id_type_expenses')
|
||||
->references('id')->on('type_expenses');
|
||||
$table->foreign('id_recurring')
|
||||
->references('id')->on('recurrings');
|
||||
$table->foreign('id_user')
|
||||
|
||||
@@ -13,7 +13,7 @@ return new class extends Migration
|
||||
{
|
||||
Schema::create('recurring_incomes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('id_type_expanse');
|
||||
$table->unsignedBigInteger('id_type_expenses');
|
||||
$table->unsignedBigInteger('id_recurring');
|
||||
$table->unsignedBigInteger('id_user');
|
||||
$table->double('amount')->default(0);
|
||||
@@ -21,8 +21,8 @@ return new class extends Migration
|
||||
$table->date('date');
|
||||
$table->date('end_date')->nullable();
|
||||
|
||||
$table->foreign('id_type_expanse')
|
||||
->references('id')->on('type_expanses');
|
||||
$table->foreign('id_type_expenses')
|
||||
->references('id')->on('type_expenses');
|
||||
$table->foreign('id_recurring')
|
||||
->references('id')->on('recurrings');
|
||||
$table->foreign('id_user')
|
||||
|
||||
@@ -14,14 +14,14 @@ return new class extends Migration
|
||||
Schema::create('incomes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('id_user');
|
||||
$table->unsignedBigInteger('id_type_income');
|
||||
$table->unsignedBigInteger('id_type_incomes');
|
||||
$table->double('amount');
|
||||
$table->string('description', 200)->default('');
|
||||
$table->date('date');
|
||||
|
||||
$table->foreign('id_user')
|
||||
->references('id')->on('users');
|
||||
$table->foreign('id_type_income')
|
||||
$table->foreign('id_type_incomes')
|
||||
->references('id')->on('type_incomes');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
@@ -14,14 +14,14 @@ return new class extends Migration
|
||||
Schema::create('previsional_incomes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('id_user');
|
||||
$table->unsignedBigInteger('id_type_income');
|
||||
$table->unsignedBigInteger('id_type_incomes');
|
||||
$table->double('amount');
|
||||
$table->string('description', 200)->default('');
|
||||
$table->date('date');
|
||||
|
||||
$table->foreign('id_user')
|
||||
->references('id')->on('users');
|
||||
$table->foreign('id_type_income')
|
||||
$table->foreign('id_type_incomes')
|
||||
->references('id')->on('type_incomes');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user