Aiki installation/upgrade process
From Aikiframework wiki
Contents |
Abstract
Aiki doesn't touch any file of repository or shipped in zip distribution. Aiki writes all changes in database or files created only in local site. That means, a installation o upgrading can make only copying / refreshing site.
During installation a new aiki databases is filled with tables and data, and some files are creates: config.php, .htaccess.
AIKI SQLs files
Aiki stores in /sql/ sql-plain text files. Aiki needs these for installation:
- sql/CreateTable.sql: for create tables
- sql/InsertDefaults.sql: to insert "fixed data": aiki widgets for example.
- sql/InsertVariable-in.sql : to insert initial data, that can be change by a aiki admin, for example configuration, users.
For a site, you must add CreateTableSite.sql, InsertDefaultsSite, InsertVariable-inSite.sql, in sqls directory (installer and upgrader will read them). All are optional.
In a installation aiki executes in this order: 1. CreateTables.sql 2. InsertDefaults.sql 3. InsertVariable-in.sql 4. CreateTablesSite.sql 5. InsertDefaultsSite.sql 6. InsertVariable-inSite.sq
For upgrade there area a fourth SQL, UpdateDefaults. As InsertDefault insert records in aiki, Update will delete them before, to allow overwritten. Again, a site can add UpdateDefaultsSite.sql
In a upgrade aiki :
1) check and update table structure using CreateTables.sql and (if exists) CreateTablesSite.sql
2) executes sql in this order:
1. UpdateDefaults.sql 2. InsertDefaults.sql 3. UpdateDefaultsSite.sql 4. InsertDefaultsSite.sql
SQLs files syntax
All SQL can obtained using phpmyadmin (over a mysql database), and exporting to SQL. It is important preserve the line comments
-- ------------------------------------------------------

