Skip to content

Commit a0015ae

Browse files
committed
Merge tou_versions and tou_acceptances migration and set version as CHAR(10)
1 parent c3894ba commit a0015ae

2 files changed

Lines changed: 13 additions & 28 deletions

File tree

database/migrations/2026_01_08_091559_tou_version.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

database/migrations/2026_01_08_113952_tou_acceptances.php renamed to database/migrations/2026_01_08_144222_update_tou_versions_and_tou_acceptances_tables.php.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,20 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration {
7+
return new class extends Migration
8+
{
89
/**
910
* Run the migrations.
1011
*/
11-
public function up(): void {
12+
public function up(): void
13+
{
14+
Schema::table('tou_versions', function (Blueprint $table) {
15+
$table->dropColumn('id');
16+
$table->char('version', 10)->primary()->change();
17+
});
18+
1219
Schema::table('tou_acceptances', function (Blueprint $table) {
13-
$table->string('tou_version', 10)->change();
20+
$table->char('tou_version', 10)->change();
1421
$table->foreign('tou_version')
1522
->references('version')
1623
->on('tou_versions')
@@ -22,7 +29,9 @@ public function up(): void {
2229
/**
2330
* Reverse the migrations.
2431
*/
25-
public function down(): void {
32+
public function down(): void
33+
{
34+
Schema::dropIfExists('tou_versions');
2635
Schema::dropIfExists('tou_acceptances');
2736
}
2837
};

0 commit comments

Comments
 (0)