Versions Compared

Key

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

...

  1. describe database table columns in "Fields" array:
    1. make "db_type" field option used to describe database type (e.g. "varchar(255)") required
    2. add new optional "db_extra" field option of array type, where "auto_increment" and other db column options are defined
  2. describe index structure in the new "Indexes" unit config option like so (the field specified in "IDField" of unit config is automatically assigned an "auto_increment" db extra and added as primary key): 

    Code Block
    'Indexes' => 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 (but won't delete columns/tables, because of performance)
    3. integrate code, that creates multi-lingual columns (e.g. "l1_Name") into this command
  4. replace "Rebuild Multilingual Fields" action on "System Tools" page with "Rebuild Database Structure" action that would call above created command
  5. run above created command before SQL migrations during deploy
  6. if table column has association with another database table, then define it via new "foreign_key" field option (won't be used for now) like so: 

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

...