URL Shortener
1.0
A Laravel-based URL shortener application
Chargement...
Recherche...
Aucune correspondance
2026_01_30_100328_create_short_urls_table.php
Aller à la documentation de ce fichier.
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
return
new
class
extends
Migration
8
{
14
public
function
up
(): void
15
{
16
Schema::create(
'short_urls'
,
function
(Blueprint $table) {
17
$table->id();
18
$table->foreignId(
'user_id'
)->constrained()->onDelete(
'cascade'
);
19
$table->string(
'code'
, 16)->unique();
20
$table->text(
'original_url'
);
21
$table->timestamps();
22
});
23
}
24
30
public
function
down
(): void
31
{
32
Schema::dropIfExists(
'short_urls'
);
33
}
34
};
Migration
Definition
0001_01_01_000000_create_users_table.php:8
Migration\down
down()
Reverse the migrations.
Definition
2026_01_30_100328_create_short_urls_table.php:30
Migration\up
up()
Run the migrations.
Definition
2026_01_30_100328_create_short_urls_table.php:14
database
migrations
2026_01_30_100328_create_short_urls_table.php
Généré le Samedi 7 Février 2026 12:00:11 pour URL Shortener par
1.9.8