Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. use meta types, that would internally map to actual MySQL data types (better create meta types from currently used MySQL data types), e.g.:
    • date - "INT(10) NULL"
    • money - "DECIMAL(20,4) NULL"
    • int32 - "INT(10)"
    • int64 - "BIGINT(20)"
    • and so on
  2. describe index structure in the "DBIndexes" unit config option like so: 

    Code Block
    'DBIndexes' => array(
    	'IDX_INDEX_NAME' => array(
    		'columns' => array('DBColumn1', 'DBColumn2'),
    		'unique' => true,
    	),
    ),
  3. create the "in-portal db:sync" command, that will:
    1. create missing database tables
    2. change structure of existing tables to match one from unit config
  4. if table column has association with another database table, then define it via new "foreign_key" field option like so: 

    Code Block
    'Fields' => array(    'ItemResourceId' => array(
            'type' => 'int',
            ...,
            'default' => null, 'foreign_key' => 'l:ResourceId'
        ),
    ),

Related Discussions

Related Tasks