Skip to content

Commit

Permalink
Tables and fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Thombrix committed Oct 28, 2023
1 parent 8ed5718 commit 4f1d172
Show file tree
Hide file tree
Showing 9 changed files with 195 additions and 0 deletions.
11 changes: 11 additions & 0 deletions backend-laravel/app/Models/Canton.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Canton extends Model
{
use HasFactory;
}
11 changes: 11 additions & 0 deletions backend-laravel/app/Models/Cycle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Cycle extends Model
{
use HasFactory;
}
11 changes: 11 additions & 0 deletions backend-laravel/app/Models/Langue.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Langue extends Model
{
use HasFactory;
}
11 changes: 11 additions & 0 deletions backend-laravel/app/Models/Ville.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Ville extends Model
{
use HasFactory;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?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('villes', function (Blueprint $table) {
$table->id();
$table->string("name");
$table->string("img");
$table->string("ecusson");
$table->integer("population")->unsigned();
$table->string("coord");
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('villes');
}
};
Original file line number Diff line number Diff line change
@@ -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('cantons', function (Blueprint $table) {
$table->id();
$table->string("name");
$table->string("img");
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('cantons');
}
};
Original file line number Diff line number Diff line change
@@ -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::create('langues', function (Blueprint $table) {
$table->id();
$table->string("name");
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('langues');
}
};
Original file line number Diff line number Diff line change
@@ -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('cycles', function (Blueprint $table) {
$table->id();
$table->text("shuffledList");
$table->integer("index")->unsigned();
$table->integer("count")->unsigned();
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('cycles');
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?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('langues_villes', function (Blueprint $table) {

$table->unsignedBigInteger('author_id');
$table->unsignedBigInteger('book_id');

$table->primary(['author_id', 'book_id']);

$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('langues_villes');
}
};

0 comments on commit 4f1d172

Please sign in to comment.