Last Updated: 3/8/2026
Database Schema
Overview
LinkAce uses a relational database (MySQL, PostgreSQL, or SQLite) to store all application data. This document outlines the main database tables and their relationships.
Core Tables
users
Stores user account information.
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| name | varchar | User’s display name |
| varchar | Email address (unique) | |
| email_verified_at | timestamp | Email verification timestamp |
| password | varchar | Hashed password |
| remember_token | varchar | Remember me token |
| created_at | timestamp | Account creation time |
| updated_at | timestamp | Last update time |
Indexes:
- Primary:
id - Unique:
email
links
Stores bookmark/link information.
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| user_id | bigint | Foreign key to users |
| url | text | The bookmark URL |
| title | varchar | Link title |
| description | text | Link description |
| is_private | boolean | Privacy flag |
| check_disabled | boolean | Disable link checking |
| icon | varchar | Favicon path |
| created_at | timestamp | Creation time |
| updated_at | timestamp | Last update time |
| deleted_at | timestamp | Soft delete timestamp |
Indexes:
- Primary:
id - Foreign:
user_idreferencesusers(id) - Index:
created_at,is_private - Soft delete:
deleted_at
Relationships:
- Belongs to:
User - Has many:
LinkCheck,Note - Belongs to many:
Tag,List
tags
Stores tags for categorizing links.
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| user_id | bigint | Foreign key to users |
| name | varchar | Tag name |
| is_private | boolean | Privacy flag |
| created_at | timestamp | Creation time |
| updated_at | timestamp | Last update time |
Indexes:
- Primary:
id - Foreign:
user_idreferencesusers(id) - Index:
name
Relationships:
- Belongs to:
User - Belongs to many:
Link
lists
Stores curated lists of links.
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| user_id | bigint | Foreign key to users |
| name | varchar | List name |
| description | text | List description |
| is_private | boolean | Privacy flag |
| created_at | timestamp | Creation time |
| updated_at | timestamp | Last update time |
Indexes:
- Primary:
id - Foreign:
user_idreferencesusers(id)
Relationships:
- Belongs to:
User - Belongs to many:
Link
link_tag
Pivot table for link-tag relationships (many-to-many).
| Column | Type | Description |
|---|---|---|
| link_id | bigint | Foreign key to links |
| tag_id | bigint | Foreign key to tags |
Indexes:
- Foreign:
link_idreferenceslinks(id)ON DELETE CASCADE - Foreign:
tag_idreferencestags(id)ON DELETE CASCADE - Unique:
(link_id, tag_id)
link_list
Pivot table for link-list relationships (many-to-many).
| Column | Type | Description |
|---|---|---|
| link_id | bigint | Foreign key to links |
| list_id | bigint | Foreign key to lists |
Indexes:
- Foreign:
link_idreferenceslinks(id)ON DELETE CASCADE - Foreign:
list_idreferenceslists(id)ON DELETE CASCADE - Unique:
(link_id, list_id)
Monitoring & Archives
link_checks
Stores link check history and status.
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| link_id | bigint | Foreign key to links |
| status_code | integer | HTTP status code |
| status | varchar | Check status (success, failed, moved) |
| created_at | timestamp | Check time |
Indexes:
- Primary:
id - Foreign:
link_idreferenceslinks(id)ON DELETE CASCADE - Index:
created_at
Relationships:
- Belongs to:
Link
archives
Stores Internet Archive Wayback Machine snapshots.
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| link_id | bigint | Foreign key to links |
| archive_url | text | Wayback Machine URL |
| created_at | timestamp | Archive creation time |
Indexes:
- Primary:
id - Foreign:
link_idreferenceslinks(id)ON DELETE CASCADE
Relationships:
- Belongs to:
Link
Additional Features
notes
Stores user notes attached to links.
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| link_id | bigint | Foreign key to links |
| user_id | bigint | Foreign key to users |
| note | text | Note content |
| is_private | boolean | Privacy flag |
| created_at | timestamp | Creation time |
| updated_at | timestamp | Last update time |
Indexes:
- Primary:
id - Foreign:
link_idreferenceslinks(id)ON DELETE CASCADE - Foreign:
user_idreferencesusers(id)ON DELETE CASCADE
Relationships:
- Belongs to:
Link,User
api_tokens
Stores API authentication tokens.
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| user_id | bigint | Foreign key to users |
| name | varchar | Token name/description |
| token | varchar | Hashed token (unique) |
| last_used_at | timestamp | Last usage timestamp |
| created_at | timestamp | Creation time |
| updated_at | timestamp | Last update time |
Indexes:
- Primary:
id - Foreign:
user_idreferencesusers(id)ON DELETE CASCADE - Unique:
token
Relationships:
- Belongs to:
User
settings
Stores system and user settings.
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| user_id | bigint | Foreign key to users (null for system settings) |
| key | varchar | Setting key |
| value | text | Setting value (JSON or string) |
| created_at | timestamp | Creation time |
| updated_at | timestamp | Last update time |
Indexes:
- Primary:
id - Foreign:
user_idreferencesusers(id)ON DELETE CASCADE - Unique:
(user_id, key)
Laravel Framework Tables
migrations
Tracks applied database migrations.
| Column | Type | Description |
|---|---|---|
| id | int | Primary key |
| migration | varchar | Migration name |
| batch | int | Migration batch number |
failed_jobs
Stores failed queue jobs for retry.
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| uuid | varchar | Unique job identifier |
| connection | text | Queue connection |
| queue | text | Queue name |
| payload | longtext | Job payload |
| exception | longtext | Exception details |
| failed_at | timestamp | Failure timestamp |
Indexes:
- Primary:
id - Unique:
uuid
password_reset_tokens
Stores password reset tokens.
| Column | Type | Description |
|---|---|---|
| varchar | User email | |
| token | varchar | Reset token |
| created_at | timestamp | Creation time |
Indexes:
- Primary:
email
sessions
Stores user session data (if using database sessions).
| Column | Type | Description |
|---|---|---|
| id | varchar | Session ID |
| user_id | bigint | Foreign key to users (nullable) |
| ip_address | varchar | Client IP |
| user_agent | text | Client user agent |
| payload | longtext | Session data |
| last_activity | int | Last activity timestamp |
Indexes:
- Primary:
id - Index:
user_id,last_activity
jobs
Stores queued jobs (if using database queue).
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| queue | varchar | Queue name |
| payload | longtext | Job payload |
| attempts | tinyint | Retry attempts |
| reserved_at | int | Reserved timestamp |
| available_at | int | Available timestamp |
| created_at | int | Creation timestamp |
Indexes:
- Primary:
id - Index:
queue
Database Relationships Diagram
users
├── has many → links
├── has many → tags
├── has many → lists
├── has many → notes
└── has many → api_tokens
links
├── belongs to → user
├── has many → link_checks
├── has many → archives
├── has many → notes
├── belongs to many → tags (via link_tag)
└── belongs to many → lists (via link_list)
tags
├── belongs to → user
└── belongs to many → links (via link_tag)
lists
├── belongs to → user
└── belongs to many → links (via link_list)Performance Considerations
Indexing Strategy
- Primary Keys: All tables have auto-incrementing primary keys
- Foreign Keys: All foreign keys are indexed for join performance
- Search Fields:
title,description,urlare full-text indexed - Filter Fields:
is_private,created_atare indexed for filtering
Query Optimization
- Use eager loading for relationships to prevent N+1 queries
- Implement pagination for large result sets
- Use database-level caching for frequently accessed data
- Utilize query scopes for common filters
Soft Deletes
The links table uses soft deletes:
- Deleted items have
deleted_attimestamp set - Items can be restored from trash
- Permanent deletion removes the record entirely
Migrations
All schema changes are version-controlled via Laravel migrations in:
database/migrations/Running migrations:
php artisan migrateRolling back:
php artisan migrate:rollbackDatabase Collation
For proper Unicode support and case-insensitive searches:
- MySQL:
utf8mb4_unicode_ci(default) - PostgreSQL:
en_US.utf8 - SQLite: UTF-8 encoding
See Adjusting Database Collation for details.
Backup Recommendations
- Automated Backups: Use LinkAce’s built-in backup feature
- Database Dumps: Regular mysqldump/pg_dump backups
- Replication: Set up database replication for high availability
- Point-in-Time Recovery: Enable binary logging (MySQL) or WAL archiving (PostgreSQL)
See Application Backups for configuration.