BLOG-95 Seperate SQL migration files #98
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "BLOG-95_rename_sql_migration_file"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
v0.3.0
migration has been run, a manual revertion is required; in real environment, there is nothing to do, but to do #97 and remove migration record forv0.1.1
manually.Package Changes
No response
Screenshots
No response
Reference
Resolves #95
Checklist
/improve
PR Code Suggestions ✨
Change email index type
Hash indexes in PostgreSQL have significant limitations, such as not supporting
range queries,
LIKE
operators, orORDER BY
clauses. For anemail
column, a B-treeindex is generally more versatile and performs better for common search patterns.
Consider changing the index type to B-tree for broader query support.
backend/migrations/20250801062412_create_user_table.sql [14-15]
Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies that a
HASH
index on anemail
column has significant limitations in PostgreSQL. Changing it to a B-tree index would provide broader query support and better performance for common email search patterns.Increase email column length
The
email
column is currently defined asVARCHAR(100)
. Some valid email addressescan exceed this length, potentially leading to data truncation or insertion
failures. It is recommended to use a larger
VARCHAR
length (e.g.,VARCHAR(255)
) orTEXT
type to accommodate longer email addresses and prevent data loss.backend/migrations/20250801062412_create_user_table.sql [6]
Suggestion importance[1-10]: 8
__
Why: The suggestion is accurate;
VARCHAR(100)
can be too short for some valid email addresses, potentially leading to data truncation. Increasing the length toVARCHAR(255)
or usingTEXT
is a good practice to prevent data loss and ensure data integrity.BLOG-95 refactor: seperate sql migration filesto BLOG-95 Seperate SQL migration filesAddressed in
8938bd3c61
.Ignore because such a long email is not common