|
9 | 9 | use Illuminate\Database\Migrations\Migration; |
10 | 10 |
|
11 | 11 | return new class() extends Migration { |
12 | | - |
13 | | - public const CAT = 'cat'; |
| 12 | + public const CAT = 'cat'; |
14 | 13 | public const ORDER = 'order'; |
15 | 14 | public const MAX_ORDER = 32767; |
16 | 15 |
|
17 | 16 | public const TIMELINE = 'Mod Timeline'; |
18 | 17 | public const MOD_NSFW = 'Mod NSFW'; |
19 | 18 |
|
20 | | - /** |
21 | | - * Run the migrations. |
22 | | - */ |
23 | | - public function up(): void |
24 | | - { |
25 | | - DB::table('configs')->where('key', '=', 'hide_nsfw_in_timeline')->update([ |
26 | | - self::CAT => self::MOD_NSFW, |
27 | | - self::ORDER => self::MAX_ORDER, |
28 | | - ]); |
| 19 | + /** |
| 20 | + * Run the migrations. |
| 21 | + */ |
| 22 | + public function up(): void |
| 23 | + { |
| 24 | + DB::table('configs')->where('key', '=', 'hide_nsfw_in_timeline')->update([ |
| 25 | + self::CAT => self::MOD_NSFW, |
| 26 | + self::ORDER => self::MAX_ORDER, |
| 27 | + ]); |
29 | 28 |
|
30 | | - DB::table('configs')->where('key', '=', 'timeline_page_enabled')->update([ self::ORDER => 1]); |
31 | | - DB::table('configs')->where('key', '=', 'timeline_photos_layout')->update([ self::ORDER => 2, 'details' => '']); |
32 | | - DB::table('configs')->where('key', '=', 'timeline_photos_order')->update([ self::ORDER => 3]); |
33 | | - DB::table('configs')->where('key', '=', 'timeline_photos_pagination_limit')->update([ self::ORDER => 4, 'details' => '']); |
34 | | - DB::table('configs')->where('key', '=', 'timeline_left_border_enabled')->update([ self::ORDER => 5]); |
| 29 | + DB::table('configs')->where('key', '=', 'timeline_page_enabled')->update([self::ORDER => 1]); |
| 30 | + DB::table('configs')->where('key', '=', 'timeline_photos_layout')->update([self::ORDER => 2, 'details' => '']); |
| 31 | + DB::table('configs')->where('key', '=', 'timeline_photos_order')->update([self::ORDER => 3]); |
| 32 | + DB::table('configs')->where('key', '=', 'timeline_photos_pagination_limit')->update([self::ORDER => 4, 'details' => '']); |
| 33 | + DB::table('configs')->where('key', '=', 'timeline_left_border_enabled')->update([self::ORDER => 5]); |
35 | 34 |
|
36 | | - DB::table('configs')->where('key', '=', 'timeline_albums_enabled')->update([ self::ORDER => 6]); |
37 | | - DB::table('configs')->where('key', '=', 'timeline_albums_public')->update([ self::ORDER => 7]); |
38 | | - DB::table('configs')->where('key', '=', 'timeline_albums_granularity')->update([ self::ORDER => 8]); |
| 35 | + DB::table('configs')->where('key', '=', 'timeline_albums_enabled')->update([self::ORDER => 6]); |
| 36 | + DB::table('configs')->where('key', '=', 'timeline_albums_public')->update([self::ORDER => 7]); |
| 37 | + DB::table('configs')->where('key', '=', 'timeline_albums_granularity')->update([self::ORDER => 8]); |
39 | 38 |
|
40 | | - DB::table('configs')->where('key', '=', 'timeline_photos_enabled')->update([ self::ORDER => 9]); |
41 | | - DB::table('configs')->where('key', '=', 'timeline_photos_public')->update([ self::ORDER => 10]); |
42 | | - DB::table('configs')->where('key', '=', 'timeline_photos_granularity')->update([ self::ORDER => 11]); |
| 39 | + DB::table('configs')->where('key', '=', 'timeline_photos_enabled')->update([self::ORDER => 9]); |
| 40 | + DB::table('configs')->where('key', '=', 'timeline_photos_public')->update([self::ORDER => 10]); |
| 41 | + DB::table('configs')->where('key', '=', 'timeline_photos_granularity')->update([self::ORDER => 11]); |
43 | 42 |
|
44 | | - DB::table('configs')->where('key', '=', 'timeline_album_date_format_year')->update([ self::ORDER => 12]); |
45 | | - DB::table('configs')->where('key', '=', 'timeline_album_date_format_month')->update([ self::ORDER => 13]); |
46 | | - DB::table('configs')->where('key', '=', 'timeline_album_date_format_day')->update([ self::ORDER => 14]); |
| 43 | + DB::table('configs')->where('key', '=', 'timeline_album_date_format_year')->update([self::ORDER => 12]); |
| 44 | + DB::table('configs')->where('key', '=', 'timeline_album_date_format_month')->update([self::ORDER => 13]); |
| 45 | + DB::table('configs')->where('key', '=', 'timeline_album_date_format_day')->update([self::ORDER => 14]); |
47 | 46 |
|
48 | | - DB::table('configs')->where('key', '=', 'timeline_photo_date_format_year')->update([ self::ORDER => 15]); |
49 | | - DB::table('configs')->where('key', '=', 'timeline_photo_date_format_month')->update([ self::ORDER => 16]); |
50 | | - DB::table('configs')->where('key', '=', 'timeline_photo_date_format_day')->update([ self::ORDER => 17]); |
51 | | - DB::table('configs')->where('key', '=', 'timeline_photo_date_format_hour')->update([ self::ORDER => 18]); |
| 47 | + DB::table('configs')->where('key', '=', 'timeline_photo_date_format_year')->update([self::ORDER => 15]); |
| 48 | + DB::table('configs')->where('key', '=', 'timeline_photo_date_format_month')->update([self::ORDER => 16]); |
| 49 | + DB::table('configs')->where('key', '=', 'timeline_photo_date_format_day')->update([self::ORDER => 17]); |
| 50 | + DB::table('configs')->where('key', '=', 'timeline_photo_date_format_hour')->update([self::ORDER => 18]); |
52 | 51 |
|
53 | | - DB::table('configs')->where('key', '=', 'timeline_quick_access_date_format_year')->update([ self::ORDER => 19, 'is_expert' => true]); |
54 | | - DB::table('configs')->where('key', '=', 'timeline_quick_access_date_format_month')->update([ self::ORDER => 20, 'is_expert' => true]); |
55 | | - DB::table('configs')->where('key', '=', 'timeline_quick_access_date_format_day')->update([ self::ORDER => 21, 'is_expert' => true]); |
56 | | - DB::table('configs')->where('key', '=', 'timeline_quick_access_date_format_hour')->update([ self::ORDER => 22, 'is_expert' => true]); |
57 | | - } |
| 52 | + DB::table('configs')->where('key', '=', 'timeline_quick_access_date_format_year')->update([self::ORDER => 19, 'is_expert' => true]); |
| 53 | + DB::table('configs')->where('key', '=', 'timeline_quick_access_date_format_month')->update([self::ORDER => 20, 'is_expert' => true]); |
| 54 | + DB::table('configs')->where('key', '=', 'timeline_quick_access_date_format_day')->update([self::ORDER => 21, 'is_expert' => true]); |
| 55 | + DB::table('configs')->where('key', '=', 'timeline_quick_access_date_format_hour')->update([self::ORDER => 22, 'is_expert' => true]); |
| 56 | + } |
58 | 57 |
|
59 | | - /** |
60 | | - * Reverse the migrations. |
61 | | - */ |
62 | | - public function down(): void |
63 | | - { |
64 | | - DB::table('configs')->where(self::CAT, '=', self::TIMELINE)->update([ |
65 | | - self::ORDER => self::MAX_ORDER, |
66 | | - ]); |
67 | | - DB::table('configs')->where('key', '=', 'hide_nsfw_in_timeline')->update([ |
68 | | - self::CAT => self::TIMELINE, |
69 | | - self::ORDER => self::MAX_ORDER, |
70 | | - ]); |
71 | | - } |
| 58 | + /** |
| 59 | + * Reverse the migrations. |
| 60 | + */ |
| 61 | + public function down(): void |
| 62 | + { |
| 63 | + DB::table('configs')->where(self::CAT, '=', self::TIMELINE)->update([ |
| 64 | + self::ORDER => self::MAX_ORDER, |
| 65 | + ]); |
| 66 | + DB::table('configs')->where('key', '=', 'hide_nsfw_in_timeline')->update([ |
| 67 | + self::CAT => self::TIMELINE, |
| 68 | + self::ORDER => self::MAX_ORDER, |
| 69 | + ]); |
| 70 | + } |
72 | 71 | }; |
0 commit comments