LinkStackOrg / LinkStack

LinkStack - the ultimate solution for creating a personalized & professional profile page. Showcase all your important links in one place, forget the limitation of one link on social media. Set up your personal site on your own server with just a few clicks.
https://linkstack.org
GNU Affero General Public License v3.0
2.41k stars 243 forks source link

Text input limited to 255 characters #328

Closed cln-io closed 1 year ago

cln-io commented 1 year ago

LittleLink Custom v3.3.6, set up on MySQL

I think there is a need to update some database fields either in length or in type,

In the profile, the input/text is limited to 255 image

the same for paragraphs as a link, its limited to 255 characters

image

I've looked for the database creation queries within the source, and was hoping to make a PR for it, but was somehow unable to locate where those SQL queries are located 🤦🏻‍♀️

JulianPrieber commented 1 year ago

https://github.com/JulianPrieber/littlelink-custom/blob/main/database/migrations/2014_10_12_000000_create_users_table.php

JulianPrieber commented 1 year ago

The string method in Laravel's migration builder is not limited to 255 characters by default.

JulianPrieber commented 1 year ago

I just tested this and you're right, it seems that MySQL limits these fields for some reason while SQLite doesn't.

JulianPrieber commented 1 year ago

https://github.com/JulianPrieber/littlelink-custom/blob/main/database/migrations/2014_10_12_000000_create_users_table.php

Something like this might work, I'm not sure: $table->string('littlelink_description', 1000)->nullable();

JulianPrieber commented 1 year ago

@cln-io

I wrote this code to convert an existing database:

<?php
// Connect to the database
$servername = env('DB_HOST');
$username = env('DB_USERNAME');
$password = env('DB_PASSWORD');
$dbname = env('DB_DATABASE');

$conn = mysqli_connect($servername, $username, $password, $dbname);

// Modify the column
$sql = "ALTER TABLE users MODIFY littlelink_description VARCHAR(1000)";

if (mysqli_query($conn, $sql)) {
    echo "Column modified successfully";
} else {
    echo "Error modifying column: " . mysqli_error($conn);
}

// Close the connection
mysqli_close($conn);

?>
JulianPrieber commented 1 year ago

I think using Laravel, this would be something like:

        Schema::table('users', function (Blueprint $table) {
            $table->string('littlelink_description', 1000)->change();
        });