Changes between Version 9 and Version 10 of DeveloperGuidelines/EdenMobile/Database


Ignore:
Timestamp:
02/24/17 12:21:58 (6 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/EdenMobile/Database

    v9 v10  
    7777== Default Schema ==
    7878
    79 The database schema is stored ''in'' in the database itself, in the {{{em_schema}}} table.
     79The database schema is stored in the mobile database, in the {{{em_schema}}} table.
    8080
    81 For the initial setup of the database, a static {{{emDefaultSchema}}} (in www/js/modules/schema.js) is used:
     81For the initial setup of the database, a static {{{emDefaultSchema}}} (in www/config/schema.js) is used. Once this schema has been written to the new database, it will be ignored.
    8282
    83 {{{
    84 #!js
    85 var emSchemaVersion = '1';
    86 
    87 var emDefaultSchema = {
    88 
    89     /**
    90      * Table to store the current schema version
    91      */
    92     'em_version': {
    93         'version': {
    94             type: 'string',
    95             label: 'Version',
    96             notnull: true
    97         },
    98         _records: [
    99             {'version': emSchemaVersion}
    100         ]
    101     },
    102 
    103     /**
    104      * Table to store table schemas
    105      */
    106     'em_schema': {
    107         'name': {
    108             type: 'string',
    109             label: 'Name',
    110             notnull: true
    111         },
    112         'schema': {
    113             type: 'json',
    114             label: 'Schema',
    115             notnull: true
    116         }
    117     }
    118 };
    119 }}}
    120 
    121 Once this schema has been written to the new database, it will be ignored.
    122 
     83The {{{emDefaultSchema}}} service also defines the meta-fields which are to be added to all user tables.
    12384== emSQL ==
    12485