Update comments in db/schema.sql

Please read these before changing the schema.
Recent schema changes don't follow these rules.
At some point they should be revised.
This commit is contained in:
David Anderson 2018-05-07 15:13:14 -07:00
parent 695e6f9ad4
commit cc3171fa5b
1 changed files with 41 additions and 28 deletions

View File

@ -1,33 +1,42 @@
/* If you add/change anything, update /*
boinc_db.cpp,h If you add/change tables:
and if needed: - if used by C++ code, update
py/Boinc/ db/
database.py boinc_db.cpp,h
html/ boinc_db_types.h
inc/ sched/
host.inc (host) db_dump.cpp (host, user, team)
db_ops.inc db_purge.cpp (workunit, result)
ops/ - if used by Python scripts (make_project, update_versions), update
db_update.php py/Boinc/database.py
user/ - if used by PHP code, update as needed
create_account_action.php (user) html/
team_create_action.php (team) inc/
sched/ host.inc (host)
db_dump.cpp (host, user, team) db_ops.inc
db_purge.cpp (workunit, result) ops/
*/ db_update.php
/* Fields are documented in boinc_db.h */ user/
/* Do not replace this with an automatically generated schema */ create_account_action.php (user)
team_create_action.php (team)
/* type is specified as InnoDB for most tables.
Supposedly this gives better performance.
The others (post, thread, profile) are myISAM
because it supports fulltext index
*/ */
/* fields ending with id (but not _id) are treated specially -- Most fields are documented in boinc_db_types.h
by the Python code (db_base.py)
*/ -- All fields should be not null
-- Fields should generally have a default
-- (newer MySQL versions don't have automatic defaults)
-- Engine is specified as InnoDB for most tables;
-- supposedly this gives better performance.
-- Some (post, thread, profile) are myISAM because it supports fulltext index
-- Going forward, use double for unix times (no 32-bit problem)
-- Put index definitions in constraints.sql, not here
-- fields ending with id (but not _id) are treated specially
-- by the Python code (db_base.py)
create table platform ( create table platform (
id integer not null auto_increment, id integer not null auto_increment,
@ -99,10 +108,13 @@ create table user (
show_hosts smallint not null, show_hosts smallint not null,
posts smallint not null, posts smallint not null,
-- reused: salt for weak auth -- reused: salt for weak auth
-- the following 4 not used by BOINC
seti_id integer not null, seti_id integer not null,
seti_nresults integer not null, seti_nresults integer not null,
seti_last_result_time integer not null, seti_last_result_time integer not null,
seti_total_cpu double not null, seti_total_cpu double not null,
signature varchar(254), signature varchar(254),
-- deprecated -- deprecated
has_profile smallint not null, has_profile smallint not null,
@ -131,6 +143,7 @@ create table team (
expavg_credit double not null default 0.0, /* temp */ expavg_credit double not null default 0.0, /* temp */
expavg_time double not null, expavg_time double not null,
seti_id integer not null default 0, seti_id integer not null default 0,
-- repurposed to store master ID of BOINC-wide teams
ping_user integer not null default 0, ping_user integer not null default 0,
ping_time integer unsigned not null default 0, ping_time integer unsigned not null default 0,
joinable tinyint not null default 1, joinable tinyint not null default 1,