This repository contains the initial MySQL database schema
used in the Protoweb project.
- File:
proto_web_schema.sql - Tables use the
MyISAMstorage engine. - Date fields are defined as
DATETIME(notTIMESTAMP). - Some unused fields are preserved for compatibility with an older system.
The schema uses the MyISAM engine due to legacy and compatibility reasons:
- Required by a related CodeIgniter 3 system still in production.
- Offers simpler file-based storage with minimal resource overhead.
- Allows broader compatibility with servers where
InnoDBis not guaranteed.
MyISAM does not support foreign keys or transactions.
All temporal fields use DATETIME instead of TIMESTAMP because:
TIMESTAMPin MySQL is limited to the year 2038 (32-bit signed int).DATETIMEsupports a wider date range (1000-01-01to9999-12-31) and is not affected by the 2038 problem.- Timezone-independent behavior ensures consistency across environments.
Because DATETIME does not auto-update,
you must set values explicitly in PHP.
// Manual update using NOW()
$db->query('UPDATE my_table SET updated_at = NOW() WHERE id = ?', [$id]);
// CodeIgniter active record with raw expression
$this->db->set('updated_at', 'NOW()', false);
// Manual value using PHP
$data = [
'updated_at' => date('Y-m-d H:i:s')
];
$this->db->update('my_table', $data);This schema includes unused or legacy fields that are retained for:
- Full compatibility with an older CodeIgniter 3-based system.
- Smooth migration between shared codebases.
- Avoiding breakage in shared libraries or controllers that expect those fields.
Feel free to ignore or remove them if you're building a fresh implementation.
To import the schema into your MySQL server:
mysql -u your_user -p your_database < proto_web_schema.sqlBSD 2-Clause License — see LICENSE