ttpos / url

A simple and efficient URL shortener
https://t.a.app/
0 stars 0 forks source link

Enhance Database Uniqueness and Fix Worker Script #5

Closed cd996 closed 2 months ago

cd996 commented 2 months ago

addresses several crucial improvements and refinements:

  1. Database Enhancements:

    • Introduced composite unique indexes on the 'links' and 'pages' tables to ensure the uniqueness of domain and shortcode combinations, thereby eliminating duplicate entries.
    • Modified 'links' and 'pages' tables to utilize hash values for uniqueness based on user IDs and URL/template data, replacing the prior unique indexes on short codes and domain names.
    • Altered the userId field from integer to text to provide greater flexibility.
    • Revised indexes and unique constraints to accommodate the new hash-based uniqueness.
  2. Worker Script Fixes:

    • Amended references in the Cloudflare Pages worker type generation script.
    • Adjusted the ESLint configuration to exclude additional files during the build process.

Changes Made: