diff --git a/src/database/migrations/2014_10_12_000000_create_users_table.php b/src/database/migrations/2014_10_12_000000_create_users_table.php index 4a3ba47..1cac7dd 100644 --- a/src/database/migrations/2014_10_12_000000_create_users_table.php +++ b/src/database/migrations/2014_10_12_000000_create_users_table.php @@ -1,8 +1,8 @@ dropColumn('banner_image_url'); - }); + // Only up migrations are allowed } } diff --git a/src/database/migrations/2019_08_12_024829_admin_and_settings.php b/src/database/migrations/2019_08_12_024829_admin_and_settings.php index 3517115..3945b47 100644 --- a/src/database/migrations/2019_08_12_024829_admin_and_settings.php +++ b/src/database/migrations/2019_08_12_024829_admin_and_settings.php @@ -1,8 +1,8 @@ dropColumn('bio'); - $table->dropColumn('profile_pic_id'); - $table->dropColumn('role'); - }); + // Only up migrations are allowed } } diff --git a/src/database/migrations/2020_01_27_213243_insert_admin_account.php b/src/database/migrations/2020_01_27_213243_insert_admin_account.php index c737067..9f5b2da 100644 --- a/src/database/migrations/2020_01_27_213243_insert_admin_account.php +++ b/src/database/migrations/2020_01_27_213243_insert_admin_account.php @@ -47,8 +47,6 @@ public function up() */ public function down() { - User::truncate(); - Setting::truncate(); - Category::truncate(); + // Only up migrations are allowed } } diff --git a/src/database/migrations/2020_02_07_052601_drafts_and_categories.php b/src/database/migrations/2020_02_07_052601_drafts_and_categories.php index 591f1ab..9a5c96a 100644 --- a/src/database/migrations/2020_02_07_052601_drafts_and_categories.php +++ b/src/database/migrations/2020_02_07_052601_drafts_and_categories.php @@ -34,17 +34,6 @@ public function up() */ public function down() { - // Split so SQLite via test suite can work since it doesn't support multiple actions at once when renaming - Schema::table('posts', function (Blueprint $table) { - $table->renameColumn('category_id', 'category'); - }); - - Schema::table('posts', function (Blueprint $table) { - $table->dropColumn('published'); - }); - - Schema::table('users', function (Blueprint $table) { - $table->dropSoftDeletes(); - }); + // Only up migrations are allowed } } diff --git a/src/database/migrations/2020_02_23_042950_nullable_categories.php b/src/database/migrations/2020_02_23_042950_nullable_categories.php index ae5be86..9b94f99 100644 --- a/src/database/migrations/2020_02_23_042950_nullable_categories.php +++ b/src/database/migrations/2020_02_23_042950_nullable_categories.php @@ -25,8 +25,6 @@ public function up() */ public function down() { - Schema::table('categories', function (Blueprint $table) { - $table->string('category')->change(); - }); + // Only up migrations are allowed } } diff --git a/src/database/migrations/2022_03_24_164358_create_sessions_table.php b/src/database/migrations/2022_03_24_164358_create_sessions_table.php index c455537..c1a9b4e 100644 --- a/src/database/migrations/2022_03_24_164358_create_sessions_table.php +++ b/src/database/migrations/2022_03_24_164358_create_sessions_table.php @@ -30,6 +30,6 @@ public function up() */ public function down() { - Schema::dropIfExists('sessions'); + // Only up migrations are allowed } }; diff --git a/src/database/migrations/2022_07_20_011845_remove_post_reading_time.php b/src/database/migrations/2022_07_20_011845_remove_post_reading_time.php index abf406a..42024b5 100644 --- a/src/database/migrations/2022_07_20_011845_remove_post_reading_time.php +++ b/src/database/migrations/2022_07_20_011845_remove_post_reading_time.php @@ -25,8 +25,6 @@ public function up() */ public function down() { - Schema::table('posts', function (Blueprint $table) { - $table->string('reading_time')->nullable(); - }); + // Only up migrations are allowed } }; diff --git a/src/database/migrations/2023_02_19_222155_remove_user_id_column_from_categories.php b/src/database/migrations/2023_02_19_222155_remove_user_id_column_from_categories.php index d8ae5b4..49e6eb9 100644 --- a/src/database/migrations/2023_02_19_222155_remove_user_id_column_from_categories.php +++ b/src/database/migrations/2023_02_19_222155_remove_user_id_column_from_categories.php @@ -25,8 +25,6 @@ public function up() */ public function down() { - Schema::table('categories', function (Blueprint $table) { - $table->integer('user_id'); - }); + // Only up migrations are allowed } }; diff --git a/src/database/migrations/2023_09_20_040645_add_indexes.php b/src/database/migrations/2023_09_20_040645_add_indexes.php index 9f211ef..bf18804 100644 --- a/src/database/migrations/2023_09_20_040645_add_indexes.php +++ b/src/database/migrations/2023_09_20_040645_add_indexes.php @@ -35,22 +35,6 @@ public function up(): void */ public function down(): void { - Schema::table('categories', function (Blueprint $table) { - $table->dropUnique(['category']); - $table->string('category')->nullable(true)->change(); - }); - - Schema::table('comments', function (Blueprint $table) { - $table->dropIndex('comments_post_id_index'); - }); - - Schema::table('posts', function (Blueprint $table) { - $table->dropIndex('posts_category_id_index'); - $table->dropIndex('posts_user_id_index'); - }); - - Schema::table('users', function (Blueprint $table) { - $table->dropIndex('users_name_index'); - }); + // Only up migrations are allowed } }; diff --git a/src/database/migrations/2023_09_20_055545_fix_post_field_types.php b/src/database/migrations/2023_09_20_055545_fix_post_field_types.php index 9ac1ca7..3251d3f 100644 --- a/src/database/migrations/2023_09_20_055545_fix_post_field_types.php +++ b/src/database/migrations/2023_09_20_055545_fix_post_field_types.php @@ -23,10 +23,6 @@ public function up(): void */ public function down(): void { - Schema::table('posts', function (Blueprint $table) { - $table->string('category_id')->nullable()->change(); - $table->text('keywords')->nullable()->change(); - $table->longText('post')->change(); - }); + // Only up migrations are allowed } }; diff --git a/src/database/migrations/2023_09_20_214931_add_foreign_keys.php b/src/database/migrations/2023_09_20_214931_add_foreign_keys.php index 327c590..c2d7c3c 100644 --- a/src/database/migrations/2023_09_20_214931_add_foreign_keys.php +++ b/src/database/migrations/2023_09_20_214931_add_foreign_keys.php @@ -38,32 +38,6 @@ public function up(): void */ public function down(): void { - Schema::table('comments', function (Blueprint $table) { - $table->dropForeign('comments_user_id_foreign'); - $table->dropForeign('comments_post_id_foreign'); - - $table->dropIndex('comments_user_id_foreign'); - $table->renameIndex('comments_post_id_foreign', 'comments_post_id_index'); - }); - - // Changes must be done separately from dropping indexes - Schema::table('comments', function (Blueprint $table) { - $table->integer('user_id')->change(); - $table->integer('post_id')->change(); - }); - - Schema::table('posts', function (Blueprint $table) { - $table->dropForeign('posts_user_id_foreign'); - $table->dropForeign('posts_category_id_foreign'); - - $table->renameIndex('posts_category_id_foreign', 'posts_category_id_index'); - $table->renameIndex('posts_user_id_foreign', 'posts_user_id_index'); - }); - - // Changes must be done separately from dropping indexes - Schema::table('posts', function (Blueprint $table) { - $table->integer('user_id')->change(); - $table->integer('category_id')->nullable()->change(); - }); + // Only up migrations are allowed } }; diff --git a/src/database/migrations/2023_09_20_225423_overhaul_photos_table.php b/src/database/migrations/2023_09_20_225423_overhaul_photos_table.php index 81abb06..5997bb9 100644 --- a/src/database/migrations/2023_09_20_225423_overhaul_photos_table.php +++ b/src/database/migrations/2023_09_20_225423_overhaul_photos_table.php @@ -55,50 +55,6 @@ public function up(): void */ public function down(): void { - Schema::rename('images', 'photos'); - - Schema::table('photos', function (Blueprint $table) { - $table->integer('subdirectory')->change(); - $table->integer('filename')->change(); - $table->string('url'); - }); - - // Split so SQLite via test suite can work since it doesn't support renaming multiple columns at once - Schema::table('photos', function (Blueprint $table) { - $table->renameColumn('subdirectory', 'user_id'); - }); - - // Split so SQLite via test suite can work since it doesn't support renaming multiple columns at once - Schema::table('photos', function (Blueprint $table) { - $table->renameColumn('filename', 'post_id'); - }); - - Schema::table('users', function (Blueprint $table) { - $table->dropForeign('users_image_id_foreign'); - $table->dropIndex('users_image_id_foreign'); - }); - - Schema::table('users', function (Blueprint $table) { - $table->integer('image_id')->nullable()->change(); - }); - - // Split so SQLite via test suite can work since it doesn't support renaming multiple columns at once - Schema::table('users', function (Blueprint $table) { - $table->renameColumn('image_id', 'profile_pic_id'); - }); - - // Split so SQLite via test suite can work since it doesn't support renaming multiple columns at once - Schema::table('posts', function (Blueprint $table) { - $table->renameColumn('image_id', 'banner_image_url'); - }); - - Schema::table('posts', function (Blueprint $table) { - $table->dropForeign('posts_image_id_foreign'); - $table->dropIndex('posts_image_id_foreign'); - }); - - Schema::table('posts', function (Blueprint $table) { - $table->string('banner_image_url')->change(); - }); + // Only up migrations are allowed } };