Database Schema
Pubvana uses a single MySQL/MariaDB database. All tables are created and managed through CI4 migrations located in app/Database/Migrations/. This section documents the core table structure and naming conventions.
Migration Management
Migrations are run automatically on install and during plugin activation. To run manually:
php spark migrate
php spark migrate --all # includes migrations from plugins
php spark db:seed # runs seeders for default data
To roll back:
php spark migrate:rollback
Schema Groups
Tables are grouped by function:
| Group | Tables |
|---|---|
| Content | posts, pages, categories, tags, posts_to_categories, tags_to_posts, comments, post_revisions |
| Appearance | themes, theme_options, widgets, widget_areas, widget_instances |
| Navigation | navigation |
| Media | media |
| Users | (Shield-managed: users, auth_groups, auth_permissions, etc.) + author_profiles |
| System | plugins, settings, languages, redirects, admin_notifications |
| Marketplace | marketplace_items, marketplace_licenses |
| Analytics | activity_logs, page_views |
| Affiliates | affiliate_links, affiliate_clicks |
| SEO / Links | broken_link_results |
| Social | social |
Subsections
- Core Tables — key columns for every table
- Conventions — naming rules, data types, and status enums