Skip to content

Commit 12a1ae0

Browse files
fix: remove status migration
1 parent e722341 commit 12a1ae0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

database/migrations/2024_07_13_090447_create_fathers_table.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ public function up(): void
2020

2121
if (DB::getDriverName() == 'mysql' || DB::getDriverName() == 'mariadb') {
2222
$table->string('full_name')->virtualAs("CONCAT(first_name, ' ', last_name)");
23-
$table->string('status')->storedAs('IF(active = 1, TRUE, FALSE)');
23+
//$table->string('status')->storedAs('IF(active = 1, TRUE, FALSE)');
2424
}
2525

2626
if ((float) App::version() >= Constants::VERSION_AFTER_STORED_AS_VIRTUAL_AS_SUPPORT && DB::getDriverName() == 'sqlite') {
2727
$table->string('full_name')->virtualAs("first_name || ' ' || last_name"); // (MySQL/PostgreSQL/SQLite)
28-
$table->string('status')->storedAs("CASE WHEN active = 1 THEN 'Active' ELSE 'Inactive' END"); // (MySQL/PostgreSQL/SQLite)
28+
//$table->string('status')->storedAs("CASE WHEN active = 1 THEN 'Active' ELSE 'Inactive' END"); // (MySQL/PostgreSQL/SQLite)
2929
}
3030

3131
if ((float) App::version() >= Constants::VERSION_AFTER_STORED_AS_VIRTUAL_AS_SUPPORT && DB::getDriverName() == 'pgsql') {
3232
$table->string('full_name')->storedAs("first_name || ' ' || last_name");
33-
$table->string('status')->storedAs("CASE WHEN active THEN 'Active' ELSE 'Inactive' END");
33+
//$table->string('status')->storedAs("CASE WHEN active THEN 'Active' ELSE 'Inactive' END");
3434
}
3535

3636

tests/BackupTablesTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function test_generate_multiple_table_backup()
148148

149149
if (DB::getDriverName() == 'mysql' || DB::getDriverName() == 'mariadb' || (float) App::version() >= Constants::VERSION_AFTER_STORED_AS_VIRTUAL_AS_SUPPORT) {
150150
$this->assertEquals(DB::table($tableName)->value('full_name'), DB::table($newTableName)->value('full_name')); // StoredAs tables
151-
$this->assertEquals(DB::table($tableName)->value('status'), DB::table($newTableName)->value('status')); // virtualAs tables
151+
//$this->assertEquals(DB::table($tableName)->value('status'), DB::table($newTableName)->value('status')); // todo remove if not needed
152152
}
153153

154154
$this->assertEquals(DB::table($tableName2)->value('father_id'), DB::table($newTableName2)->value('father_id')); // foreign key

0 commit comments

Comments
 (0)