@@ -14,16 +14,12 @@ class UpdateColumnsToTextType extends Migration
14
14
public function up ()
15
15
{
16
16
Schema::table ('users ' , function (Blueprint $ table ) {
17
- $ table ->text ('littlelink_description ' )->nullable ()-> change ();
17
+ $ table ->text ('littlelink_description ' )->change ();
18
18
});
19
-
19
+
20
20
Schema::table ('links ' , function (Blueprint $ table ) {
21
- $ table ->text ('title ' )->nullable ()-> change ();
21
+ $ table ->text ('title ' )->change ();
22
22
});
23
-
24
- // Set the new character limit to 1000 for both columns
25
- DB ::statement ('ALTER TABLE users MODIFY COLUMN littlelink_description TEXT(1000) ' );
26
- DB ::statement ('ALTER TABLE links MODIFY COLUMN title TEXT(1000) ' );
27
23
}
28
24
29
25
/**
@@ -34,15 +30,11 @@ public function up()
34
30
public function down ()
35
31
{
36
32
Schema::table ('users ' , function (Blueprint $ table ) {
37
- $ table ->string ('littlelink_description ' , 255 )->nullable ()-> change ();
33
+ $ table ->string ('littlelink_description ' , 255 )->change ();
38
34
});
39
35
40
36
Schema::table ('links ' , function (Blueprint $ table ) {
41
- $ table ->string ('title ' , 255 )->nullable ()-> change ();
37
+ $ table ->string ('title ' , 255 )->change ();
42
38
});
43
-
44
- // Revert the character limit to 255 for both columns
45
- DB ::statement ('ALTER TABLE users MODIFY COLUMN littlelink_description VARCHAR(255) ' );
46
- DB ::statement ('ALTER TABLE links MODIFY COLUMN title VARCHAR(255) ' );
47
39
}
48
40
}
0 commit comments